Skip to content
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

chore: add POST payload validation #6

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions api/openapispec/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3753,18 +3753,18 @@ const docTemplate = `{
"constant.SourceProviderType": {
"type": "string",
"enum": [
"git",
"git",
"github",
"oci",
"local",
"git"
"local"
],
"x-enum-varnames": [
"DefaultSourceType",
"SourceProviderTypeGit",
"SourceProviderTypeGithub",
"SourceProviderTypeOCI",
"SourceProviderTypeLocal",
"DefaultSourceType"
"SourceProviderTypeLocal"
]
},
"constant.StackState": {
Expand Down Expand Up @@ -4919,6 +4919,7 @@ const docTemplate = `{
"request.CreateBackendRequest": {
"type": "object",
"required": [
"backendConfig",
"name"
],
"properties": {
Expand Down Expand Up @@ -4975,6 +4976,7 @@ const docTemplate = `{
"request.CreateOrganizationRequest": {
"type": "object",
"required": [
"name",
"owners"
],
"properties": {
Expand Down Expand Up @@ -5005,7 +5007,8 @@ const docTemplate = `{
"request.CreateProjectRequest": {
"type": "object",
"required": [
"domain"
"name",
"path"
],
"properties": {
"description": {
Expand Down Expand Up @@ -5188,8 +5191,7 @@ const docTemplate = `{
"request.UpdateBackendRequest": {
"type": "object",
"required": [
"id",
"name"
"id"
],
"properties": {
"backendConfig": {
Expand Down Expand Up @@ -5248,8 +5250,7 @@ const docTemplate = `{
"request.UpdateOrganizationRequest": {
"type": "object",
"required": [
"id",
"owners"
"id"
],
"properties": {
"description": {
Expand Down Expand Up @@ -5283,7 +5284,6 @@ const docTemplate = `{
"request.UpdateProjectRequest": {
"type": "object",
"required": [
"domain",
"id"
],
"properties": {
Expand Down Expand Up @@ -5334,10 +5334,7 @@ const docTemplate = `{
"request.UpdateSourceRequest": {
"type": "object",
"required": [
"id",
"name",
"remote",
"sourceProvider"
"id"
],
"properties": {
"description": {
Expand Down Expand Up @@ -5379,8 +5376,7 @@ const docTemplate = `{
"request.UpdateStackRequest": {
"type": "object",
"required": [
"id",
"name"
"id"
],
"properties": {
"description": {
Expand Down
28 changes: 12 additions & 16 deletions api/openapispec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3742,18 +3742,18 @@
"constant.SourceProviderType": {
"type": "string",
"enum": [
"git",
"git",
"github",
"oci",
"local",
"git"
"local"
],
"x-enum-varnames": [
"DefaultSourceType",
"SourceProviderTypeGit",
"SourceProviderTypeGithub",
"SourceProviderTypeOCI",
"SourceProviderTypeLocal",
"DefaultSourceType"
"SourceProviderTypeLocal"
]
},
"constant.StackState": {
Expand Down Expand Up @@ -4908,6 +4908,7 @@
"request.CreateBackendRequest": {
"type": "object",
"required": [
"backendConfig",
"name"
],
"properties": {
Expand Down Expand Up @@ -4964,6 +4965,7 @@
"request.CreateOrganizationRequest": {
"type": "object",
"required": [
"name",
"owners"
],
"properties": {
Expand Down Expand Up @@ -4994,7 +4996,8 @@
"request.CreateProjectRequest": {
"type": "object",
"required": [
"domain"
"name",
"path"
],
"properties": {
"description": {
Expand Down Expand Up @@ -5177,8 +5180,7 @@
"request.UpdateBackendRequest": {
"type": "object",
"required": [
"id",
"name"
"id"
],
"properties": {
"backendConfig": {
Expand Down Expand Up @@ -5237,8 +5239,7 @@
"request.UpdateOrganizationRequest": {
"type": "object",
"required": [
"id",
"owners"
"id"
],
"properties": {
"description": {
Expand Down Expand Up @@ -5272,7 +5273,6 @@
"request.UpdateProjectRequest": {
"type": "object",
"required": [
"domain",
"id"
],
"properties": {
Expand Down Expand Up @@ -5323,10 +5323,7 @@
"request.UpdateSourceRequest": {
"type": "object",
"required": [
"id",
"name",
"remote",
"sourceProvider"
"id"
],
"properties": {
"description": {
Expand Down Expand Up @@ -5368,8 +5365,7 @@
"request.UpdateStackRequest": {
"type": "object",
"required": [
"id",
"name"
"id"
],
"properties": {
"description": {
Expand Down
16 changes: 6 additions & 10 deletions api/openapispec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ definitions:
constant.SourceProviderType:
enum:
- git
- git
- github
- oci
- local
- git
type: string
x-enum-varnames:
- DefaultSourceType
- SourceProviderTypeGit
- SourceProviderTypeGithub
- SourceProviderTypeOCI
- SourceProviderTypeLocal
- DefaultSourceType
constant.StackState:
enum:
- UnSynced
Expand Down Expand Up @@ -864,6 +864,7 @@ definitions:
description: Name is the name of the backend.
type: string
required:
- backendConfig
- name
type: object
request.CreateModuleRequest:
Expand Down Expand Up @@ -908,6 +909,7 @@ definitions:
type: string
type: array
required:
- name
- owners
type: object
request.CreateProjectRequest:
Expand Down Expand Up @@ -942,7 +944,8 @@ definitions:
description: SourceID is the configuration source id associated with the project.
type: integer
required:
- domain
- name
- path
type: object
request.CreateSourceRequest:
properties:
Expand Down Expand Up @@ -1060,7 +1063,6 @@ definitions:
type: string
required:
- id
- name
type: object
request.UpdateModuleRequest:
properties:
Expand Down Expand Up @@ -1107,7 +1109,6 @@ definitions:
type: array
required:
- id
- owners
type: object
request.UpdateProjectRequest:
properties:
Expand Down Expand Up @@ -1144,7 +1145,6 @@ definitions:
description: SourceID is the configuration source id associated with the project.
type: integer
required:
- domain
- id
type: object
request.UpdateSourceRequest:
Expand Down Expand Up @@ -1176,9 +1176,6 @@ definitions:
type: string
required:
- id
- name
- remote
- sourceProvider
type: object
request.UpdateStackRequest:
properties:
Expand Down Expand Up @@ -1218,7 +1215,6 @@ definitions:
type: string
required:
- id
- name
type: object
request.UpdateWorkspaceRequest:
properties:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kusionstack/kusion-api-client-sdk",
"version": "1.1.0",
"version": "1.1.1",
"description": "Kusion API Client SDK",
"main": "dist/src/client/index.js",
"types": "dist/src/client/index.d.ts",
Expand Down
20 changes: 10 additions & 10 deletions src/client/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export const constant_RunTypeSchema = {
} as const;

export const constant_SourceProviderTypeSchema = {
enum: ['git', 'github', 'oci', 'local', 'git'],
enum: ['git', 'git', 'github', 'oci', 'local'],
type: 'string',
'x-enum-varnames': ['SourceProviderTypeGit', 'SourceProviderTypeGithub', 'SourceProviderTypeOCI', 'SourceProviderTypeLocal', 'DefaultSourceType']
'x-enum-varnames': ['DefaultSourceType', 'SourceProviderTypeGit', 'SourceProviderTypeGithub', 'SourceProviderTypeOCI', 'SourceProviderTypeLocal']
} as const;

export const constant_StackStateSchema = {
Expand Down Expand Up @@ -1152,7 +1152,7 @@ export const request_CreateBackendRequestSchema = {
type: 'string'
}
},
required: ['name'],
required: ['backendConfig', 'name'],
type: 'object'
} as const;

Expand Down Expand Up @@ -1211,7 +1211,7 @@ export const request_CreateOrganizationRequestSchema = {
type: 'array'
}
},
required: ['owners'],
required: ['name', 'owners'],
type: 'object'
} as const;

Expand Down Expand Up @@ -1256,7 +1256,7 @@ export const request_CreateProjectRequestSchema = {
type: 'integer'
}
},
required: ['domain'],
required: ['name', 'path'],
type: 'object'
} as const;

Expand Down Expand Up @@ -1414,7 +1414,7 @@ export const request_UpdateBackendRequestSchema = {
type: 'string'
}
},
required: ['id', 'name'],
required: ['id'],
type: 'object'
} as const;

Expand Down Expand Up @@ -1477,7 +1477,7 @@ export const request_UpdateOrganizationRequestSchema = {
type: 'array'
}
},
required: ['id', 'owners'],
required: ['id'],
type: 'object'
} as const;

Expand Down Expand Up @@ -1526,7 +1526,7 @@ export const request_UpdateProjectRequestSchema = {
type: 'integer'
}
},
required: ['domain', 'id'],
required: ['id'],
type: 'object'
} as const;

Expand Down Expand Up @@ -1567,7 +1567,7 @@ export const request_UpdateSourceRequestSchema = {
type: 'string'
}
},
required: ['id', 'name', 'remote', 'sourceProvider'],
required: ['id'],
type: 'object'
} as const;

Expand Down Expand Up @@ -1620,7 +1620,7 @@ export const request_UpdateStackRequestSchema = {
type: 'string'
}
},
required: ['id', 'name'],
required: ['id'],
type: 'object'
} as const;

Expand Down
Loading
Loading