Is there a way to arrange API Categories and Endpoints in Swagger?
I'm using swagger-jsdoc and swagger-ui modules with Node.js.
Thanks!
I think what you need is tags: https://swagger.io/docs/specification/grouping-operations-with-tags/
Related
I added OData to my .NET Web API. I only use it for querying data (HttpMethod GET).
When I run my application, and I look at Swagger I see the following:
As you can see, the OData endpoints use uppercase name for the resource set which I something I really dislike. It's important to note that the endpoints work fine even in lowercase.
How can I make it so that the OData endpoints use lowercase by default to create consistency in my swagger documentation?
Thanks in advance
Use:
services.AddRouting(options => options.LowercaseUrls = true);
In your startup.cs
I know that we can have examples in the drop down menu for each parameter in the openapi spec. This requires to select each example for each parameter.
I was wondering if it is possible to have a drop down menu for the endpoint that we can select the example and that example has the values for all parameters in that endpoint.
This is not supported - neither by the OpenAPI Specification nor in Swagger UI. Here's an existing feature request in the OpenAPI Specification repository:
https://github.com/OAI/OpenAPI-Specification/issues/1673
I set up a basic JHipster project and generated an entity that supports filtering with JDL.
The generator made a Swagger API which I use for querying the database.
The Swagger API doc shows me a list of parameters which can be used to build query.
The template query looks like this:
GET /api/client?name.equals=john&surname.equals=doe&country.in=uk&country.in=de
The request works fine but the parameters are chained like name==john OR surname==doe OR country==uk OR country==de so I get all johns, does, and everoyne from uk and de.
This is ok, but for some queries i need name==john AND surname==doe so not all Johns and Does but specifically John Doe. I searched here and on the swagger forum but couldn't find the answer.
My question is: how do I achieve changing the OR to AND in the query?
Does this swagger query support AND or do I have to make changes in the backend?
Your question is not about swagger, this is why you could not find anything in swagger forum.
It's about JHipster JPA entity filtering and the answer is no: you can't generate code that would use a OR.
You must code it yourself, look at the *QueryService classes and assemble your criteria with the logic you need.
I am using swagger with rest api. Can i modify the swagger json(or yaml) ? I want to customise it like i want to split the #defnitions into #requestdefinition & #responsedefinition. Please guide me.
I'm writing a RESTful service using odata4j and need to be able to set the caching header of the response.
How do I do this?
I don't seem to have access to the HttpservletResponse object.
And unlike the JAX-RS support, I can't see anything in odata4j that lets me get hold of a CacheControl object.
Thanks
Sarah
No direct support for this as of 0.5 - however you could write a custom ContainerResponseFilter to modify the outgoing response manually.
Feel free to add a feature request on the project issue list [1], along with any detail on a proposed api if you have thoughts on how this might work.
Or, of course, a patch... : )
Hope that helps,
- john
[1] http://code.google.com/p/odata4j/issues/list