-
Notifications
You must be signed in to change notification settings - Fork 153
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
feat(ocm): add openApi schema and OpenApiRouter #2050
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and everything works!
One suggestion and one question for you.
One thing I would mention is that I didn't add Update: fixed |
3b4e8a0
to
0ec0873
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, might need to pull in the latest changes to get the CI to pass
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Description:
Introduces openapi schema for ocm-backend.
Introduces autogeneration of openapi documentation via
yarn build:api-docs
Introduces
openapi-utils
dependency that adds:Some examples:
(When
openapi.yaml
specifies endpoint /example that requires name query param.)For example when calling
/example
endpoint without name:option to autogenerate client code like Apis via:
yarn backstage-repo-tools package schema openapi generate client --client-package <directory>
For ocm, this command could be run when inside ocm-backend folder:
yarn backstage-repo-tools package schema openapi generate client --client-package plugins/ocm-common
Example of how this autogenerated code looks like can be seen here:
https://github.com/backstage/backstage/tree/master/packages/catalog-client/src/generated
this could be used to generate catalog entities with swagger openapi docs (haven't tried this one yet)
https://www.npmjs.com/package/@backstage/plugin-catalog-backend-module-backstage-openapi
The
openapi.generated.ts
needs to be regenerated when openapi schema changes via running:yarn build:api-server
."@backstage/repo-tools"` must be installed in root workspace for it to run.
Reference: https://backstage.io/docs/openapi/01-getting-started/
Fixes:
RHIDP-3570