-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Swagger/OpenAPI definition for client generation #255
base: master
Are you sure you want to change the base?
Conversation
For now only CORE APIs have been mapped, next commits will implement the rest of them. |
Added the rest of exposed APIs. Some descriptions/summaries are missing (related to parameters, request body and responses). It would be nice if developers/maintainers could add details to make the definition complete. The only known issue (already discussed in Discord) is related to the In this case the options are: |
How does the authentication work? |
The |
I see. |
I guess I start carpet bombing with questions until I can publish/update a plugin :) Is |
I'll make sure to update the specs with the "token" parameter in all the requests that require it. However I'm unsure about the use of enums in OpenAPI specs, since some client/server generators do not handle language-specific enums in the same way, and since the are just Strings on the frontend but actually a |
On the frontend they are a fixed set of strings. An enum is how it shows up when I look at it from my side, that int behind the curtain is not relevant. From a consumer perspective it is a breeding ground for annoying errors. If not then just more code to try to validate a fixed set of strings based on cross referencing the website, that will break in annoying ways. Instead of just knowing what it wants me to hand over, and building around it.
If a client does not understand enums that match the specification then that is not the api's fault. |
Good lord. Do I have to send both category AND category id? Only one of them is not sufficient, while they seem to mean the same thing. |
At least for POST requests, it doesn't seem so. For GET requests, Where is it failing for you just by providing the category_id ? |
I understand it now then. Remove the category name from places where sending it is invalid. I'm not sure how it could be documented then. The other enums work out now. The best I can think of is to type out the ids in the description but that is also a bit out there. Still better than nothing. |
Well, I feel like I should apologize to that beautiful person who will have to look at my 5 "useless" edits on my addon, but It works now. Everything but the categories are coming from the api definition, and validated according to whatever is in that. https://plugins.gradle.org/plugin/io.github.frontrider.godle-publish |
This PR adds the Swagger/OpenAPI definition for the AssetLib APIs in order to test them through SwaggerUI and generate clients with different programming languages.