Skip to content

Commit

Permalink
fix: OpenAPI metadata discriminator
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Mortari <[email protected]>
  • Loading branch information
tarilabs committed Feb 22, 2024
1 parent edefcc4 commit ce656aa
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions api/openapi/model-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1102,50 +1102,96 @@ components:
- $ref: "#/components/schemas/MetadataStructValue"
- $ref: "#/components/schemas/MetadataProtoValue"
- $ref: "#/components/schemas/MetadataBoolValue"
discriminator:
propertyName: metadataType
mapping:
MetadataBoolValue: '#/components/schemas/MetadataBoolValue'
MetadataDoubleValue: '#/components/schemas/MetadataDoubleValue'
MetadataIntValue: '#/components/schemas/MetadataIntValue'
MetadataProtoValue: '#/components/schemas/MetadataProtoValue'
MetadataStringValue: '#/components/schemas/MetadataStringValue'
MetadataStructValue: '#/components/schemas/MetadataStructValue'
description: A value in properties.
MetadataIntValue:
description: An integer (int64) property value.
type: object
required:
- metadataType
- int_value
properties:
int_value:
format: int64
type: string
metadataType:
type: string
example: MetadataIntValue
MetadataDoubleValue:
description: A double property value.
type: object
required:
- metadataType
- double_value
properties:
double_value:
format: double
type: number
metadataType:
type: string
example: MetadataDoubleValue
MetadataStringValue:
description: A string property value.
type: object
required:
- metadataType
- string_value
properties:
string_value:
type: string
metadataType:
type: string
example: MetadataStringValue
MetadataStructValue:
description: A struct property value.
type: object
required:
- metadataType
- struct_value
properties:
struct_value:
description: Base64 encoded bytes for struct value
type: string
metadataType:
type: string
example: MetadataStructValue
MetadataProtoValue:
description: A proto property value.
type: object
required:
- metadataType
- type
- proto_value
properties:
type:
description: url describing proto value
type: string
proto_value:
description: Base64 encoded bytes for proto value
type: string
metadataType:
type: string
example: MetadataProtoValue
MetadataBoolValue:
description: A bool property value.
type: object
required:
- metadataType
- bool_value
properties:
bool_value:
type: boolean
metadataType:
type: string
example: MetadataBoolValue
BaseResource:
allOf:
- $ref: "#/components/schemas/BaseResourceCreate"
Expand Down

0 comments on commit ce656aa

Please sign in to comment.