Horreum icon indicating copy to clipboard operation
Horreum copied to clipboard

OpenAPI spec does not giver clear example of POST endpoint with query params

Open johnaohara opened this issue 1 year ago • 13 comments

for example:

https://horreum.hyperfoil.io/openapi/#tag/Run/operation/addRunFromData

Gives an example of POST /api/run/data

instead of ;

POST /api/run/data?test=my-test&schema=...

johnaohara avatar Nov 20 '23 14:11 johnaohara

@johnaohara this website url shows a blank page in a browser. Is this issue still relevant ?

whitingjr avatar Feb 22 '24 11:02 whitingjr

@whitingjr yes, this is still an issue @stalep asked me about it yesterday, but we have not updated this issue.

this website url shows a blank page in a browser.

Which browser are you using? are there any errors logged in the console?

johnaohara avatar Feb 22 '24 11:02 johnaohara

We need to get redocly to generate Requests samples for POST endpoints that accept query params: https://redocly.com/docs/openapi-visual-reference/parameter/#query-parameter

atm, we do not know how to annotate the rest endpoint with the smallrye-openapi annotations to achieve this

johnaohara avatar Feb 22 '24 11:02 johnaohara

@whitingjr yes, this is still an issue @stalep asked me about it yesterday, but we have not updated this issue.

this website url shows a blank page in a browser.

Which browser are you using? are there any errors logged in the console?

FF122. There is a message in the console. Uncaught ReferenceError: jQuery is not defined

whitingjr avatar Feb 22 '24 12:02 whitingjr

On FF122, i see the same error in the console (which we should fix), but the screen renders

image

johnaohara avatar Feb 22 '24 12:02 johnaohara

My browser is working after enabling a blocked domain. Back to the question. Is there some mechanism for the example to have additional parameters via the openapi config ?

whitingjr avatar Feb 22 '24 13:02 whitingjr

I would assume so, because the redocly guide shows it: https://redocly.com/docs/openapi-visual-reference/parameter/#query-parameter

How that yaml is generated by the smallrey-openapi generator? I don't know

johnaohara avatar Feb 22 '24 13:02 johnaohara

Are you seeking this ability to do curl requests which is in the page you linked too ?

sample-request

whitingjr avatar Feb 22 '24 16:02 whitingjr

Something like that yes.

right now, in the tutorials we show how to callt eh endpoint with curl : https://horreum.hyperfoil.io/docs/tutorials/create-test-run/, i.e.;

curl 'http://localhost:8080/api/run/data?test='$TEST'&start='$START'&stop='$STOP'&owner='$OWNER'&access='$ACCESS \ -s -H 'content-type: application/json' -H 'Authorization: Bearer '$TOKEN \ -d @/tmp/run.json

But the openapi spec is not providing the relevant examples, and it should

johnaohara avatar Feb 22 '24 17:02 johnaohara

I think that's only available when using the Developer Portal. developer-portal

whitingjr avatar Feb 22 '24 17:02 whitingjr

As we are using Redoc (community) it has missing features provided by the open-core Redocly.

whitingjr avatar Mar 04 '24 13:03 whitingjr

I reviewed alternative projects. None are providing both

  • static site content
  • ability to show example query parameters along with the API request

whitingjr avatar Mar 12 '24 13:03 whitingjr

@johnaohara given the above situation is impractical with current features are you ok with closing this issue ?

whitingjr avatar Mar 12 '24 13:03 whitingjr