-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Generate OpenAPI client libraries #2060
Conversation
Thanks. I will pull and update your branch to use gitlab ci schedules to generate these packages, and I'll create a |
Ah, I wasn't sure which one to use since there's also a `.gitlab-ci.yaml` in the repo. Didn't know which one took precedence.
How can I help publishing the packages to their respective indices (if it is needed at all)? I specifically need the Python client lib which is the major reason I started all of this.
Thanks for considering this PR
|
Hi @Chocobozzz, I checked https://framagit.org/framasoft/peertube and the Should I lend a hand writing the |
Hi, sorry for the late reply. I created the repository: https://framagit.org/framasoft/peertube/peertube-rest-api-packages Please create a MR on framagit 👍 |
See merge request framasoft/peertube/PeerTube!28, which continued #2060
Related to #2052 "Publish OpenAPI clients" this pullrequest introduces a
openapi
stage in.travis.yaml
that can be triggered either forcefully or by pushing a tag.Stages
The travis doc on stages explains the concepts.
test
All previous jobs in the
matrix:
are now in thejobs:
dict and have been put into this stage. It is activated by default but can be deactivated byNO_TESTING
=true in the repository setting (or environment variable)openapi
This stage will generate and then publish the clients passed to the job on travis.
Client lib generation
The repository setting (or environment var)
API_LANGS
is a:
delimited list of client libs to generate.A list of possible clients can be found here.
Requirements
A parameter config in the
/openapi
folder for the client e.g/openapi/python.yaml
. The params can be generated by running the docker openapi-cli (see/scripts/openapi-clients.sh
) e.gopenapitools/openapi-generator-cli config-help -g python
Client lib publication
The client lib will be pushed to a github repository of the format
"https://github.com/${API_GIT_USER}/${API_REPO_PREFIX}${lang}.git"
.See
/scripts/openapi-clients.sh
for the required environment variables.Examples
https://github.com/LoveIsGrief/peertube-api-kotlin
https://github.com/LoveIsGrief/peertube-api-go
https://github.com/LoveIsGrief/peertube-api-python
TODO in down the line
versioning: each package config can have a version (maybe the same as peertube?)
the python template doesn't like a multi-lined description (see the repo above and it will be glaringly obvious)
Modify the
.travis.yaml
of each published client lib to:List each published package in the API documentation.