Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

OpenAPI: absolute URL for "Upload a release asset" endpoint #422

Open
gr2m opened this issue May 22, 2019 · 3 comments
Open

OpenAPI: absolute URL for "Upload a release asset" endpoint #422

gr2m opened this issue May 22, 2019 · 3 comments
Labels
feature New feature or request

Comments

@gr2m
Copy link
Contributor

gr2m commented May 22, 2019

The route for Upload a release asset is POST :upload_url.

The OpenAPI spec works around a base URL -> relative paths -> http method, it throws an error for {upload_url} as it expects paths to start with a /.

I’m not quite sure where to put this route in the OpenAPI spec right now

@gr2m gr2m changed the title OpenAPI: absolute URL for OpenAPI: absolute URL for "Upload a release asset" endpoint May 22, 2019
@gr2m
Copy link
Contributor Author

gr2m commented May 29, 2019

ping @bobby-brennan I hope you don’t mind? Thanks for your help at APIs-guru/unofficial_openapi_specs#12 🙏

I wonder if you can think of a way to model and endpoint which URL is entirely variable in OpenAPI? I tried a few things e.g. with the servers property but to no avail ...

@rbren
Copy link

rbren commented May 29, 2019

This might be impossible. Some resources:
Overriding Servers section here: https://swagger.io/docs/specification/api-host-and-base-path/
OAI/OpenAPI-Specification#892
OAI/OpenAPI-Specification#1459

However, it looks to me like upload_url might always be of the form:

https://uploads.github.com/repos/{user}/{repo}/releases/{release}/assets

If that's the case, you could set the path to /repos/{user}/{repo}/releases/{release}/assets, and set servers on that operation to https://upload.github.com

Otherwise, I would just put these instructions in the documentation for https://developer.github.com/v3/repos/releases/#create-a-release

@gr2m
Copy link
Contributor Author

gr2m commented May 29, 2019

However, it looks to me like upload_url might always be of the form:

https://uploads.github.com/repos/{user}/{repo}/releases/{release}/assets

Unfortunately the URL looks different for Enterprise Instances, I think its {enterprise_host}/api/uploads/repos/{user}/{repo}/releases/{release}/assets.

But that could potentially be addressed using servers I think.

Thanks so much for your help!

@gr2m gr2m mentioned this issue May 29, 2019
33 tasks
@gr2m gr2m added this to the OpenAPI specification milestone May 30, 2019
@gr2m gr2m self-assigned this Jun 27, 2019
@gr2m gr2m added the feature New feature or request label May 5, 2020
@gr2m gr2m removed their assignment May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants