Skip to content

Commit

Permalink
add variable component
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Nov 14, 2024
1 parent bcef450 commit b4f46d1
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 124 deletions.
21 changes: 21 additions & 0 deletions apps/webservice/src/app/api/v1/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,26 @@ export const openapi: Swagger.SwaggerV3 = {
name: "x-api-key",
},
},
schemas: {
Variable: {
type: "object",
required: ["key", "value"],
properties: {
key: {
type: "string",
},
value: {
oneOf: [
{ type: "string" },
{ type: "number" },
{ type: "boolean" },
],
},
sensitive: {
type: "boolean",
},
},
},
},
},
};
38 changes: 2 additions & 36 deletions apps/webservice/src/app/api/v1/resources/[targetId]/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,7 @@ export const openapi: Swagger.SwaggerV3 = {
variables: {
type: "array",
items: {
type: "object",
properties: {
key: {
type: "string",
},
value: {
oneOf: [
{ type: "string" },
{ type: "number" },
{ type: "boolean" },
],
},
sensitive: {
type: "boolean",
default: false,
},
},
required: ["key", "value"],
$ref: "#/components/schemas/Variable",
},
},
},
Expand Down Expand Up @@ -187,24 +170,7 @@ export const openapi: Swagger.SwaggerV3 = {
variables: {
type: "array",
items: {
type: "object",
properties: {
key: {
type: "string",
},
value: {
oneOf: [
{ type: "string" },
{ type: "number" },
{ type: "boolean" },
],
},
sensitive: {
type: "boolean",
default: false,
},
},
required: ["key", "value"],
$ref: "#/components/schemas/Variable",
},
},
},
Expand Down
18 changes: 1 addition & 17 deletions apps/webservice/src/app/api/v1/resources/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,7 @@ export const openapi: Swagger.SwaggerV3 = {
variables: {
type: "array",
items: {
type: "object",
required: ["key", "value"],
properties: {
key: {
type: "string",
},
value: {
oneOf: [
{ type: "string" },
{ type: "number" },
{ type: "boolean" },
],
},
sensitive: {
type: "boolean",
},
},
$ref: "#/components/schemas/Variable",
},
},
},
Expand Down
101 changes: 30 additions & 71 deletions openapi.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1020,30 +1020,7 @@
"variables": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"sensitive": {
"type": "boolean",
"default": false
}
},
"required": ["key", "value"]
"$ref": "#/components/schemas/Variable"
}
}
},
Expand Down Expand Up @@ -1131,30 +1108,7 @@
"variables": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"sensitive": {
"type": "boolean",
"default": false
}
},
"required": ["key", "value"]
"$ref": "#/components/schemas/Variable"
}
}
}
Expand Down Expand Up @@ -1345,29 +1299,7 @@
"variables": {
"type": "array",
"items": {
"type": "object",
"required": ["key", "value"],
"properties": {
"key": {
"type": "string"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"sensitive": {
"type": "boolean"
}
}
"$ref": "#/components/schemas/Variable"
}
}
}
Expand Down Expand Up @@ -1725,6 +1657,33 @@
}
},
"components": {
"schemas": {
"Variable": {
"type": "object",
"required": ["key", "value"],
"properties": {
"key": {
"type": "string"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"sensitive": {
"type": "boolean"
}
}
}
},
"securitySchemes": {
"apiKey": {
"type": "apiKey",
Expand Down

0 comments on commit b4f46d1

Please sign in to comment.