Kong / docs.konghq.com

🦍 Source code for docs.konghq.com website.
https://docs.konghq.com
MIT License
193 stars 577 forks source link

Add developer portal /files POST example #4413

Open mark-sivill-kong opened 1 year ago

mark-sivill-kong commented 1 year ago

Where is the problem?

https://docs.konghq.com/gateway/latest/developer-portal/portal-api/#/

What happened?

Hi,

Noticed there isn't currently a POST example for the /files endpoint for the scenario of adding an OpenAPI specification to the portal.

I have been able to do this with the following cul command -

 curl -X POST localhost:8001/files -F "path=specs/tfl_openapi.yaml" -F "contents=@tfl_openapi.yaml"

Thanks

Mark

What did you expect to happen?

A POST example next to https://docs.konghq.com/gateway/latest/developer-portal/portal-api/#/operations/list-files

Code of Conduct and Community Expectations

rjseibert commented 1 year ago

I also would like to see operations around file manipulation. I see a 404 at the docs link posted, and would like to see CRUD operations on all files/entities within the dev portal.

afzal442 commented 1 year ago

I believe the correct link is supposed to be https://docs.konghq.com/gateway/latest/kong-enterprise/dev-portal/portal-api/#/operations/list-files

hi @mark-sivill-kong, can you add the POST response as well?

rjseibert commented 1 year ago

I believe the correct link is supposed to be https://docs.konghq.com/gateway/latest/kong-enterprise/dev-portal/portal-api/#/operations/list-files

hi @mark-sivill-kong, can you add the POST response as well?

That link did work. Ideally I would like to see a DELETE example as well. If DELETE is not exposed, why not?

rjseibert commented 1 year ago

This may be on a version which we do not have. We currently are using kong 2.8.1.

afzal442 commented 1 year ago

I would like to see a DELETE example as well.

Thanks for kind response. I would urge you kindly add the response here of those you mentioned as well.

rjseibert commented 1 year ago

I would like to see a DELETE example as well.

Thanks for kind response. I would urge you kindly add the response here of those you mentioned as well.

I am not quite sure what you are asking. I see 404 responses from every /files endpoint method that I call on our kong 2.8.1 instance.

mark-sivill-kong commented 1 year ago

I've used

curl -X POST localhost:8001/files -F "path=specs/tfl_openapi.yaml" -F "contents=@tfl_openapi.yaml"

on a fresh install of Kong 2.8 with the default workspace enabled. The response returned is very large as it contains the tfl_openapi.yaml specification within the response which is many pages long. I've not included it as I don't think it adds much value. I suspect a shorter example would be more beneficial for the document i.e one with a much smaller openapi spec or use another short file that isn't an openapi spec.