Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nycdotnet
Copy link

@nycdotnet nycdotnet commented Jul 16, 2025

Hi,

Thanks for such a great library.

This PR somewhat addresses this issue: #3895 by adding a new parameter GlobalSystemNamespaceAlias.

An example of why you'd want to support this is to generate a client for the SpaceTraders.io game which has System as an entity (as in star system): https://github.com/SpaceTradersAPI/api-docs/blob/main/models/System.json

In this case, you could provide /GlobalSystemNamespaceAlias:DotNetSystem at the command line, for example, and it would bypass the problem.

This is not completely implemented - unfortunately it will require a change in NJsonSchema as well (for things like Enums which reference "System.Runtime.Serialization.EnumMember".). I am curious of your thoughts on if you would take a change of this size or if you like this solution? If so I can implement it there and update this PR. If not, no worries. We can probably also achieve this with some sort of rename logic.

Note: All tests pass with the current implementation.

Thank you!

@nycdotnet nycdotnet marked this pull request as draft July 16, 2025 04:15
@RicoSuter
Copy link
Owner

Wouldnt it be better to just preprocess the schema and rename the DTO name there to avoid conflicts (then you do not need to change NSwag/NJS at all)?

@nycdotnet
Copy link
Author

Yes you're right that would probably be better.

@nycdotnet nycdotnet closed this Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants