Swagger autodoc - Document body instead of query

Product: PowerShell Universal
Version: 3.1.4

Hi,
how can I get the swagger autodoc to document POST inputs as application/json (body) instead of query inputs (in the URL)?

Inside the API endpoint I can, of course, look into the header and make an if statement that throws an error, when it’s not application/json, but this will, of course, not show up in the swagger autodoc.

A good example would be the documentation for the POST /api/v1/accessControl API endpoint. There is a documented application/json body.

This is an open issue and referred to as OpenAPI Schemas: Support for OpenAPI Schemas · Issue #542 · ironmansoftware/issues · GitHub

Feel free to vote it up to increase the priority on it.

1 Like

I can’t find any documentation for the closed issues like the above one or Add more robust swagger documentation for endpoints · Issue #1680 · ironmansoftware/issues (github.com)

I understand the example in the linked issue regarding the http statuscodes but where do i define if a parameter is a query parameter or should be in a JSON/XML body?

Whoops. This was a miss on our part. I’ll make sure this gets done tomorrow.

1 Like