Skip to content

Commit

Permalink
fix(openapi): add missing tags to OpenAPI definitions (#459)
Browse files Browse the repository at this point in the history
Because

- Some endpoints reference tags that aren't defined at the root of the
OpenAPI
  docs.

This commit

- Adds missing tags.

---------

Co-authored-by: droplet-bot <[email protected]>
  • Loading branch information
jvallesm and droplet-bot authored Sep 20, 2024
1 parent 35cfcdf commit e0d4056
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 22 deletions.
18 changes: 9 additions & 9 deletions app/app/v1alpha/app_public_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -76,58 +76,58 @@ service AppPublicService {
post: "/v1alpha/namespaces/{namespace_id}/apps/{app_id}/conversations"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "app"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "App"};
}
// List conversations
rpc ListConversations(ListConversationsRequest) returns (ListConversationsResponse) {
option (google.api.http) = {get: "/v1alpha/namespaces/{namespace_id}/apps/{app_id}/conversations"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "app"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "App"};
}
// Update a conversation
rpc UpdateConversation(UpdateConversationRequest) returns (UpdateConversationResponse) {
option (google.api.http) = {
put: "/v1alpha/namespaces/{namespace_id}/apps/{app_id}/conversations/{conversation_id}"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "app"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "App"};
}
// Delete a conversation
rpc DeleteConversation(DeleteConversationRequest) returns (DeleteConversationResponse) {
option (google.api.http) = {delete: "/v1alpha/namespaces/{namespace_id}/apps/{app_id}/conversations/{conversation_id}"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "app"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "App"};
}
// Create a message
rpc CreateMessage(CreateMessageRequest) returns (CreateMessageResponse) {
option (google.api.http) = {
post: "/v1alpha/namespaces/{namespace_id}/apps/{app_id}/conversations/{conversation_id}/messages"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "app"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "App"};
}
// List messages
rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) {
option (google.api.http) = {get: "/v1alpha/namespaces/{namespace_id}/apps/{app_id}/conversations/{conversation_id}/messages"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "app"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "App"};
}
// Update a message
rpc UpdateMessage(UpdateMessageRequest) returns (UpdateMessageResponse) {
option (google.api.http) = {
put: "/v1alpha/namespaces/{namespace_id}/apps/{app_id}/conversations/{conversation_id}/messages/{message_uid}"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "app"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "App"};
}
// Delete a message
rpc DeleteMessage(DeleteMessageRequest) returns (DeleteMessageResponse) {
option (google.api.http) = {delete: "/v1alpha/namespaces/{namespace_id}/apps/{app_id}/conversations/{conversation_id}/messages/{message_uid}"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "app"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "App"};
}
// Update ai assistant app playground
rpc UpdateAiAssistantAppPlayground(UpdateAiAssistantAppPlaygroundRequest) returns (UpdateAiAssistantAppPlaygroundResponse) {
option (google.api.http) = {
put: "/v1alpha/namespaces/{namespace_id}/apps/{app_id}/ai_assistant_playground"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "app"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "App"};
}
}
7 changes: 6 additions & 1 deletion app/app/v1alpha/openapi.proto.templ
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
description: "App endpoints to manage app resources"
{{$info}}
}
tags: []
tags: [
{
name: "App"
description: "App endpoints"
}
]
{{$conf}}
};
2 changes: 2 additions & 0 deletions artifact/artifact/v1alpha/artifact_public_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ service ArtifactPublicService {
option (google.api.method_visibility).restriction = "INTERNAL";
}

// TODO improve public endpoint definitions with title and description.

// Create a catalog
rpc CreateCatalog(CreateCatalogRequest) returns (CreateCatalogResponse) {
option (google.api.http) = {
Expand Down
9 changes: 7 additions & 2 deletions artifact/artifact/v1alpha/openapi.proto.templ
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ import "protoc-gen-openapiv2/options/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "💾 Artifact "
description: "Artifact endpoints to manage artifact resources"
description: "Artifact endpoints to manage Instill Catalog and RAG applications",
{{$info}}
}
tags: []
tags: [
{
name: "Catalog"
description: "Catalog endpoints"
}
]
{{$conf}}
};
12 changes: 12 additions & 0 deletions model/model/v1alpha/openapi.proto.templ
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
name: "Trigger"
description: "Model trigger endpoints"
},
{
name: "Model (Deprecated)"
description: "Deprecated model endpoints"
},
{
name: "Version (Deprecated)"
description: "Deprecated version endpoints"
},
{
name: "Trigger (Deprecated)"
description: "Deprecated trigger endpoints"
},
{
name: "Region"
description: "Model region endpoints"
Expand Down
21 changes: 12 additions & 9 deletions openapiv2/app/service.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ info:
license:
name: Elastic License 2.0 (ELv2)
url: https://github.com/instill-ai/protobufs/blob/main/LICENSE
tags:
- name: App
description: App endpoints
host: api.instill.tech
schemes:
- https
Expand Down Expand Up @@ -182,7 +185,7 @@ paths:
required: false
type: boolean
tags:
- app
- App
post:
summary: Create a Conversation
operationId: AppPublicService_CreateConversation
Expand Down Expand Up @@ -215,7 +218,7 @@ paths:
schema:
$ref: '#/definitions/AppPublicServiceCreateConversationBody'
tags:
- app
- App
/v1alpha/namespaces/{namespaceId}/apps/{appId}/conversations/{conversationId}:
delete:
summary: Delete a conversation
Expand Down Expand Up @@ -249,7 +252,7 @@ paths:
required: true
type: string
tags:
- app
- App
put:
summary: Update a conversation
operationId: AppPublicService_UpdateConversation
Expand Down Expand Up @@ -287,7 +290,7 @@ paths:
schema:
$ref: '#/definitions/AppPublicServiceUpdateConversationBody'
tags:
- app
- App
/v1alpha/namespaces/{namespaceId}/apps/{appId}/conversations/{conversationId}/messages:
get:
summary: List messages
Expand Down Expand Up @@ -348,7 +351,7 @@ paths:
required: false
type: boolean
tags:
- app
- App
post:
summary: Create a message
operationId: AppPublicService_CreateMessage
Expand Down Expand Up @@ -386,7 +389,7 @@ paths:
schema:
$ref: '#/definitions/AppPublicServiceCreateMessageBody'
tags:
- app
- App
/v1alpha/namespaces/{namespaceId}/apps/{appId}/conversations/{conversationId}/messages/{messageUid}:
delete:
summary: Delete a message
Expand Down Expand Up @@ -425,7 +428,7 @@ paths:
required: true
type: string
tags:
- app
- App
put:
summary: Update a message
operationId: AppPublicService_UpdateMessage
Expand Down Expand Up @@ -468,7 +471,7 @@ paths:
schema:
$ref: '#/definitions/AppPublicServiceUpdateMessageBody'
tags:
- app
- App
/v1alpha/namespaces/{namespaceId}/apps/{appId}/ai_assistant_playground:
put:
summary: Update ai assistant app playground
Expand Down Expand Up @@ -502,7 +505,7 @@ paths:
schema:
$ref: '#/definitions/AppPublicServiceUpdateAiAssistantAppPlaygroundBody'
tags:
- app
- App
definitions:
AppPublicServiceCreateAppBody:
type: object
Expand Down
5 changes: 4 additions & 1 deletion openapiv2/artifact/service.swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
swagger: "2.0"
info:
title: "\U0001F4BE Artifact "
description: Artifact endpoints to manage artifact resources
description: Artifact endpoints to manage Instill Catalog and RAG applications
version: v0.40.1-beta
contact:
name: Instill AI
Expand All @@ -10,6 +10,9 @@ info:
license:
name: Elastic License 2.0 (ELv2)
url: https://github.com/instill-ai/protobufs/blob/main/LICENSE
tags:
- name: Catalog
description: Catalog endpoints
host: api.instill.tech
schemes:
- https
Expand Down
6 changes: 6 additions & 0 deletions openapiv2/model/service.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ tags:
description: Model version endpoints
- name: Trigger
description: Model trigger endpoints
- name: Model (Deprecated)
description: Deprecated model endpoints
- name: Version (Deprecated)
description: Deprecated version endpoints
- name: Trigger (Deprecated)
description: Deprecated trigger endpoints
- name: Region
description: Model region endpoints
host: api.instill.tech
Expand Down
6 changes: 6 additions & 0 deletions openapiv2/vdp/service.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ tags:
description: Namespace Secret endpoints
- name: Integration
description: Namespace Integration endpoints
- name: Pipeline (Deprecated)
description: Deprecated pipeline endpoints
- name: Trigger (Deprecated)
description: Deprecated trigger endpoints
- name: Release (Deprecated)
description: Deprecated release endpoints
- name: Utils
description: Utils endpoints
host: api.instill.tech
Expand Down
12 changes: 12 additions & 0 deletions vdp/pipeline/v1beta/openapi.proto.templ
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
name: "Integration"
description: "Namespace Integration endpoints"
},
{
name: "Pipeline (Deprecated)"
description: "Deprecated pipeline endpoints"
},
{
name: "Trigger (Deprecated)"
description: "Deprecated trigger endpoints"
},
{
name: "Release (Deprecated)"
description: "Deprecated release endpoints"
},
{
name: "Utils"
description: "Utils endpoints"
Expand Down

0 comments on commit e0d4056

Please sign in to comment.