0

Newbie question: I have to rebuilt an old REST API, with some clients in Swagger 2.0. Unfortunatly some of the API calls use for HTTP post the following way: For the content it uses the POST body, but for a "sitekey" it use an URL Parameter. so each post looks something like that:

POST api/update?sitekey=xxx  HTTP/1.1
....
{"json": "content"}

I must not ignore the sitekey, so how would i model such a thing in swagger?

1 Answer 1

1

If you are using Jax-rs, you can use swagger's @ApiParam annotation. Depending on the jax-rs annotation (@QueryParam, @PathParam, etc.) used along with this annotation, swagger will identify the parameter placement correctly. See here: https://github.com/swagger-api/swagger-core/wiki/Annotations#apiparam

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.