diff --git a/models/v1beta1/import.go b/models/v1beta1/import.go index a1500a711d..d10daa3f3b 100644 --- a/models/v1beta1/import.go +++ b/models/v1beta1/import.go @@ -5,16 +5,32 @@ package v1beta1 // ImportBody defines model for ImportBody. type ImportBody struct { - FileName string `json:"file_name"` - - // ModelFile This represents the binary content of the file as a byte array - ModelFile []byte `json:"model_file"` - Url string `json:"url"` + FileName string `json:"file_name" yaml:"file_name"` + Model Model `json:"model" yaml:"model"` + + // ModelFile represents the binary content of the file as a byte array + ModelFile []byte `json:"model_file" yaml:"model_file"` + Url string `json:"url" yaml:"url"` } -// ImportRequest defines model for ImportRequest. type ImportRequest struct { - ImportBody ImportBody `json:"importBody"` - Register bool `json:"register"` - UploadType string `json:"uploadType"` + ImportBody ImportBody `json:"importBody" yaml:"importBody"` + Register bool `json:"register" yaml:"register"` + UploadType string `json:"uploadType" yaml:"uploadType"` +} + +type Model struct { + Category string `json:"category" yaml:"category"` + IsAnnotation bool `json:"isAnnotation" yaml:"isAnnotation"` + Model string `json:"model" yaml:"model"` + ModelDisplayName string `json:"modelDisplayName" yaml:"modelDisplayName"` + PrimaryColor string `json:"primaryColor" yaml:"primaryColor"` + PublishToRegistry bool `json:"publishToRegistry" yaml:"publishToRegistry"` + Registrant string `json:"registrant" yaml:"registrant"` + SecondaryColor string `json:"secondaryColor" yaml:"secondaryColor"` + Shape string `json:"shape" yaml:"shape"` + SubCategory string `json:"subCategory" yaml:"subCategory"` + SvgColor string `json:"svgColor" yaml:"svgColor"` + SvgComplete string `json:"svgComplete" yaml:"svgComplete"` + SvgWhite string `json:"svgWhite" yaml:"svgWhite"` } diff --git a/schemas/constructs/openapi/mesheryHandlers.yml b/schemas/constructs/openapi/mesheryHandlers.yml index c01b621595..afb930068a 100644 --- a/schemas/constructs/openapi/mesheryHandlers.yml +++ b/schemas/constructs/openapi/mesheryHandlers.yml @@ -3,6 +3,87 @@ info: title: Meshmodels API description: API for registering and exporting mesh models version: 1.0.0 +components: + schemas: + ImportRequest: + type: object + required: + - importBody + - uploadType + - register + properties: + importBody: + $ref: '#/components/schemas/ImportBody' + uploadType: + type: string + register: + type: boolean + nullable: false + + ImportBody: + type: object + required: + - model_file + - url + - file_name + - model + properties: + model_file: + type: string + format: byte + description: "This represents the binary content of the file as a byte array" + url: + type: string + file_name: + type: string + model: + $ref: '#/components/schemas/Model' + + Model: + type: object + required: + - modelDisplayName + - registrant + - model + - category + - subCategory + - shape + - primaryColor + - secondaryColor + - svgColor + - svgWhite + - svgComplete + - isAnnotation + - publishToRegistry + properties: + modelDisplayName: + type: string + registrant: + type: string + model: + type: string + category: + type: string + subCategory: + type: string + shape: + type: string + primaryColor: + type: string + pattern: "^#[0-9A-Fa-f]{6}$" + secondaryColor: + type: string + pattern: "^#[0-9A-Fa-f]{6}$" + svgColor: + type: string + svgWhite: + type: string + svgComplete: + type: string + isAnnotation: + type: boolean + publishToRegistry: + type: boolean paths: /api/meshmodels/register: @@ -73,37 +154,3 @@ paths: '500': description: Internal server error -components: - schemas: - ImportRequest: - type: object - required: - - importBody - - uploadType - - register - properties: - importBody: - $ref: '#/components/schemas/ImportBody' - uploadType: - type: string - register: - type: boolean - nullable: false - - ImportBody: - type: object - required: - - model_file - - url - - file_name - properties: - model_file: - type: string - format: byte - description: "This represents the binary content of the file as a byte array" - url: - type: string - - file_name: - type: string -