Using .
in Swagger OperationIds makes swagger client generators fail
#192
Labels
bug
Something isn't working
This isn't a bug with the code. This is more a report of an issue with the doc examples and sample code.
In your samples/docs you have Swagger annotations like this:
Notice the
OperationId
above uses a.
as a separator. This actually causes trouble when generating API Clients from the resultingswagger.json
. You wind up with generated code like this:This fails to compile because it thinks
Author
is a namespace. The solution is to simply use a character that would be valid in a C# or TypeScript identifier, with the obvious choice being an underscore, e.g.Author_Create
.So, like I said, not a problem with
ApiEndpoints
itself, but a small discovery we made while using the samples on a recent project and using NSwag to generate a client in another project.Also, you might be thinking, Yeah? Well, you know, that's just like uh, your opinion, man.. But the Open API spec has this to say about the
operationId
:Anyways, do what you want with this information :) And thank you for this awesome library!
The text was updated successfully, but these errors were encountered: