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

fix(service-spec): allow having type object in reference types and having anyOf or oneOf in RecordLikeObject #1369

Merged
merged 8 commits into from
Oct 17, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,19 @@
"description": "FIXME: should be required but some service teams have omitted it.",
"type": "boolean"
},
"anyOf": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/CommonTypeCombinatorFields"
},
{
"$ref": "#/definitions/jsonschema.RecordLikeObject"
}
]
},
"type": "array"
},
"description": {
"type": "string"
},
Expand Down Expand Up @@ -634,6 +647,10 @@
},
"title": {
"type": "string"
},
"type": {
"const": "object",
"type": "string"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,19 @@
"description": "FIXME: should be required but some service teams have omitted it.",
"type": "boolean"
},
"anyOf": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/CommonTypeCombinatorFields"
},
{
"$ref": "#/definitions/jsonschema.RecordLikeObject"
}
]
},
"type": "array"
},
"description": {
"type": "string"
},
Expand Down Expand Up @@ -392,6 +405,10 @@
},
"title": {
"type": "string"
},
"type": {
"const": "object",
"type": "string"
}
},
"required": [
Expand Down Expand Up @@ -483,6 +500,19 @@
"description": "FIXME: should be required but some service teams have omitted it.",
"type": "boolean"
},
"anyOf": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/CommonTypeCombinatorFields"
},
{
"$ref": "#/definitions/jsonschema.RecordLikeObject"
}
]
},
"type": "array"
},
"definitions": {
"additionalProperties": {
"$ref": "#/definitions/jsonschema.Schema"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export namespace jsonschema {
}

export interface Reference extends Annotatable {
readonly type?: 'object';
readonly $ref: string;

/**
Expand Down Expand Up @@ -161,6 +162,7 @@ export namespace jsonschema {
readonly properties: ObjectProperties;
readonly required?: string[];
readonly oneOf?: (CommonTypeCombinatorFields | RecordLikeObject)[];
readonly anyOf?: (CommonTypeCombinatorFields | RecordLikeObject)[];
/**
* FIXME: should be required but some service teams have omitted it.
*/
Expand Down
Loading