Closed shainegordon closed 1 year ago
Hi @shainegordon,
Thanks very much for this suggestion, it appears to make perfect sense to add to our standard modules, I've added this to our backlog.
I'll leave this issue open until this improvement is finalized so as to provide updates.
Hi @shainegordon,
We have now completed the work for this, basic information on this is available here, but at a high level you can now apply an OpenAPI Settings
stereotype on which you can specify the an operationId
:
You will just need to make sure you have the latest pre-release versions of the Intent.Metadata.WebApi
and Intent.AspNetCore.Controllers
modules installed.
We expect to be publishing the final versions of these modules next week.
I'm closing this issue, but feel to ask any further questions you may have.
What problem are you trying to solve?
A lot of tools that create API clients from Swagger Open API specification files use the "operationId" field to build human-readable functions/methods.
Because no operationId is defined by default, swagger (and code gen tools) will do a best effort to infer these names.
So, for example, the command
DeletePriceCommand
would result in the inferred name ofdelete_api_price__id_
, while the API client generation tool might then create a function calledpriceDELETE
(this depends on how the tool is configured).Describe the solution you'd like
We would like API routes to be "named"
so instead of the following being generated (I have removed some attributes for brevity)
it would be nice if instead it was generated as follows
Notice that all that has changed here is I have added the
Name
parameter to theHttpDelete/Get/Put/Post
attribute.This then gives you a "better" experience in swagger UI
and your API client makes more sense