Hyperfoil / Horreum

Benchmark results repository service
https://horreum.hyperfoil.io/
Apache License 2.0
37 stars 31 forks source link

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

Open johnaohara opened 10 months ago

johnaohara commented 10 months ago

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=...

whitingjr commented 7 months ago

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

johnaohara commented 7 months ago

@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 commented 7 months ago

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

whitingjr commented 7 months ago

@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

johnaohara commented 7 months ago

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

image

whitingjr commented 7 months ago

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 ?

johnaohara commented 7 months ago

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

whitingjr commented 7 months ago

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

sample-request

johnaohara commented 7 months ago

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

whitingjr commented 7 months ago

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

whitingjr commented 7 months ago

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

whitingjr commented 6 months ago

I reviewed alternative projects. None are providing both

whitingjr commented 6 months ago

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