-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(openapi): generate merged spec (#497)
Because - SDKs like [tryAGI](https://github.com/tryAGI/Instill-AI) need a single OpenAPI definition. - Merging our definitions would make sense as the public API is exposed by a single service (`api-gateway`). Headers represent that service's interface rather than the backend ones. This commit - Generates a merged OpenAPI definition. - For now individual definitions are respected and used to feed openapi.instill.tech. This adds some duplication in the configuration (`/<service>/openapi.proto.templ` and `/openapiv2/conf.proto`). We need to decide if we want to use the merged OpenAPI instead (we'll lose the service as a [category](https://docs.readme.com/main/docs/openapi-categories-pages-subpages#tags-and-summaries) and the endpoints will be only grouped by tags. - Tags are respected as much as possible, just modified to avoid collisions. - Depending on whether we want to transition to this single OpenAPI for readme.com, we might consider group endpoints by service or merge some tags ([User, Organization] -> Namespace). --------- Co-authored-by: droplet-bot <[email protected]>
- Loading branch information
1 parent
9c270d2
commit 9d69b5c
Showing
29 changed files
with
10,967 additions
and
12,014 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
extends: ["spectral:oas"] | ||
rules: | ||
# When uploading the specs to readme.com, this field will be used to render | ||
# information about an endpoint. | ||
operation-description: error | ||
# Unused or missing tags produce an empty group in readme.com. | ||
operation-tag-defined: error | ||
|
||
# Exceptions | ||
|
||
# [`grpc-gateway` issue 3058](https://github.com/grpc-ecosystem/grpc-gateway/issues/3058): | ||
# Most tooling ignores keywords next to `$ref`. However, `grpc-gateway` | ||
# produces such keywords. | ||
no-$ref-siblings: off | ||
# `grpc-gateway` generates types for nested types, but sometimes these are | ||
# only used by requests (e.g. `ComponentDefinition.View`). Request structures | ||
# are defined as part of the endpoint definition, so these nested types end | ||
# up defined but not referenced. | ||
oas2-unused-definition: off | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.