Allow providing an alias for global System namespace #5208
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Systemas an entity (as in star system): https://github.com/SpaceTradersAPI/api-docs/blob/main/models/System.jsonIn this case, you could provide
/GlobalSystemNamespaceAlias:DotNetSystemat 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!