Skip to content

Change the collection type for arrays for C# models #469

Closed

Description

@jonaslagoni

Reason/Context

In Modelina for C#, you can change the type used for representing arrays, this should be possible through the CLI.

To do this I suggest we add a flag called csharpArrayType as an enum that can contain two values List or Array, where Array is the default. It should be added to the generator options as following:

  collectionType: 'List'

Which should be added here:

fileGenerator = new CSharpFileGenerator();
as the code example shows: https://github.com/asyncapi/modelina/blob/master/examples/csharp-change-collection-type/index.ts

These will be the generated results: https://github.com/asyncapi/modelina/blob/master/examples/csharp-change-collection-type/__snapshots__/index.spec.ts.snap

Remember to also add a test here:

describe('for C#', () => {

Related documentation: https://github.com/asyncapi/modelina/blob/master/docs/languages/Csharp.md#change-the-collection-type-for-arrays

Feel free to reach out if you have any questions or get stuck!

Activity

  1. added
    enhancement
    on Mar 6, 2023
  2. octonawish-akcodes commented on Mar 6, 2023

    @octonawish-akcodes

    Can I work on this

  3. jonaslagoni commented on Mar 6, 2023

    @jonaslagoni
    MemberAuthor

    @octonawish-akcodes there are no assignments or anything in that way, so it's all about just doing it 😊 Go for it 👍

  4. prayutsu commented on Mar 21, 2023

    @prayutsu
    Contributor

    @jonaslagoni if no one is working on it, can I raise a PR?

  5. jonaslagoni commented on Mar 21, 2023

    @jonaslagoni
    MemberAuthor

    Go for it @prayutsu 🙂

  6. asyncapi-bot commented on Mar 26, 2023

    @asyncapi-bot
    Contributor

    🎉 This issue has been resolved in version 0.33.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuereleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions