Skip to content

Commit

Permalink
Eliminate oneOf
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberixae committed Aug 17, 2023
1 parent 853ab19 commit 97a9390
Show file tree
Hide file tree
Showing 36 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/balances.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"definitions": {
"balanceName": {
"description": "Uniqued name for a currency",
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/currency"
},
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/booking-option.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.maas.global/core/booking-option.json",
"description": "MaaS single TSP adapter option",
"oneOf": [
"anyOf": [
{
"$ref": "#/definitions/contentWithCost"
},
Expand Down
4 changes: 2 additions & 2 deletions maas-schemas/schemas/core/booking.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"$ref": "#/definitions/id"
},
"tspId": {
"oneOf": [
"anyOf": [
{
"$ref": "#/definitions/tspId"
},
Expand All @@ -27,7 +27,7 @@
"$ref": "#/definitions/fares"
},
"cost": {
"oneOf": [
"anyOf": [
{
"$ref": "#/definitions/cost"
},
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/components/ajv.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"definitions": {
"stringCoarsedNull": {
"description": "Ajv type coarsing replaces null with empty string",
"oneOf": [
"anyOf": [
{
"type": "null"
},
Expand Down
4 changes: 2 additions & 2 deletions maas-schemas/schemas/core/components/car-rental.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"enum": ["manual", "automatic", null]
},
"fuel": {
"oneOf": [
"anyOf": [
{
"enum": [
"diesel",
Expand All @@ -90,7 +90,7 @@
]
},
"classification": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/ACRISS.json"
},
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/components/cost.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"description": "A flag indicating whether TSP price is fixed"
},
"currency": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/currency"
},
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/components/fare.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"minimum": 0
},
"currency": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/currency"
},
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/components/geometry.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "GeoJSON geometry, forked from https://github.com/fge/sample-json-schemas/ under BSD license",
"type": "object",
"required": ["type", "coordinates"],
"oneOf": [
"anyOf": [
{
"title": "Point",
"type": "object",
Expand Down
4 changes: 2 additions & 2 deletions maas-schemas/schemas/core/customer.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"type": "object",
"properties": {
"currency": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/currency"
},
Expand All @@ -173,7 +173,7 @@
"description": "key would typically match tokenId",
"properties": {
"currency": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/common.json#/definitions/metaCurrencyTOKEN"
},
Expand Down
6 changes: 3 additions & 3 deletions maas-schemas/schemas/core/personal-document.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"examples": ["2020-01-01"]
},
"validTo": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/isoDate"
},
Expand Down Expand Up @@ -180,7 +180,7 @@
"$ref": "#/definitions/kycServiceId"
},
"firstName": {
"oneOf": [
"anyOf": [
{
"$ref": "#/definitions/firstName"
},
Expand All @@ -190,7 +190,7 @@
]
},
"lastName": {
"oneOf": [
"anyOf": [
{
"$ref": "#/definitions/lastName"
},
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/plan.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.maas.global/core/plan.json",
"description": "OpenTripPlanner compatible format for plans, extended with id for legs and itineraries",
"oneOf": [{ "$ref": "#/definitions/plan1" }, { "$ref": "#/definitions/plan2" }],
"anyOf": [{ "$ref": "#/definitions/plan1" }, { "$ref": "#/definitions/plan2" }],
"definitions": {
"plan1": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/product-option.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.maas.global/core/product-option.json",
"description": "Product option for an itinerary, is either an existing booking pointer or a new booking instruction",
"oneOf": [
"anyOf": [
{ "$ref": "#/definitions/withConfigurator" },
{ "$ref": "#/definitions/withFares" },
{ "$ref": "#/definitions/withCost" }
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/product-optionV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/identityId"
},
"type": {
"oneOf": [{ "const": "BOOKING_BOOKABLE" }, { "const": "BOOKING_ESTIMATABLE" }]
"anyOf": [{ "const": "BOOKING_BOOKABLE" }, { "const": "BOOKING_ESTIMATABLE" }]
},
"product": {
"$ref": "https://schemas.maas.global/core/product.json"
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/product.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"maxLength": 255
},
"preAuthBuffer": {
"oneOf": [
"anyOf": [
{
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/core/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"properties": {
"id": {
"description": "Refers several seemingly unrelated things. Use is discouraged.",
"oneOf": [
"anyOf": [
{ "$ref": "#/definitions/bookingOptionsReference" },
{
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/identityId"
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/environments/synopsis.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"group": { "$ref": "#/definitions/groupMeta" },
"account": {
"oneOf": [
"anyOf": [
{ "$ref": "#/definitions/unknownAccount" },
{
"$ref": "https://schemas.maas.global/environments/accounts.json#/definitions/account"
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/geojson/geometry.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "GeoJSON geometry, forked from https://github.com/fge/sample-json-schemas/ under BSD license",
"type": "object",
"required": ["type", "coordinates"],
"oneOf": [
"anyOf": [
{
"title": "Point",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}
},
{
"oneOf": [
"anyOf": [
{
"type": "object",
"required": ["leg", "terms", "product", "fares"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}
},
{
"oneOf": [
"anyOf": [
{
"required": ["leg", "terms", "product", "fares"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"$ref": "https://schemas.maas.global/core/components/common.json#/definitions/agencyId"
}
},
"oneOf": [{ "required": ["partyId", "partyType"] }, { "required": ["agencyId"] }]
"anyOf": [{ "required": ["partyId", "partyType"] }, { "required": ["agencyId"] }]
},
"headers": {
"$ref": "https://schemas.maas.global/core/components/api-common.json#/definitions/headers"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"$ref": "https://schemas.maas.global/core/personal-document.json#/definitions/kycServiceId"
},
"firstName": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/personal-document.json#/definitions/firstName"
},
Expand All @@ -56,7 +56,7 @@
]
},
"lastName": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/personal-document.json#/definitions/lastName"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"maxLength": 255
}
},
"oneOf": [{ "required": ["planId"] }, { "required": ["agencyId"] }]
"anyOf": [{ "required": ["planId"] }, { "required": ["agencyId"] }]
}
},
"required": ["location"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"type": "object",
"properties": {
"firstName": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/common.json#/definitions/personalName"
},
Expand All @@ -35,7 +35,7 @@
]
},
"lastName": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/common.json#/definitions/personalName"
},
Expand All @@ -51,7 +51,7 @@
"type": "object",
"properties": {
"number": {
"oneOf": [
"anyOf": [
{
"type": "string",
"minLength": 2
Expand All @@ -68,7 +68,7 @@
"$ref": "https://schemas.maas.global/core/components/address.json#/definitions/country"
},
"validFrom": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/isoDate"
},
Expand All @@ -78,7 +78,7 @@
]
},
"validUntil": {
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/isoDate"
},
Expand All @@ -93,7 +93,7 @@
"type": "string"
},
"reasonCode": {
"oneOf": [
"anyOf": [
{
"type": "integer",
"minimum": 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.maas.global/maas-backend/itineraries/itinerary-create/response.json",
"description": "Response schema for itineraries-create",
"oneOf": [
"anyOf": [
{
"type": "object",
"properties": {
Expand Down Expand Up @@ -76,7 +76,7 @@
},
"paymentParameters": {
"description": "Payment parameters for asynchronous payment methods",
"oneOf": [
"anyOf": [
{ "$ref": "#/definitions/paymentParameter" },
{
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "array",
"minItems": 0,
"items": {
"oneOf": [
"anyOf": [
{ "$ref": "https://schemas.maas.global/core/itinerary.json" },
{ "$ref": "https://schemas.maas.global/core/itineraryV2.json" }
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "object",
"properties": {
"itinerary": {
"oneOf": [
"anyOf": [
{ "$ref": "https://schemas.maas.global/core/itinerary.json" },
{ "$ref": "https://schemas.maas.global/core/itineraryV2.json" }
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "object",
"properties": {
"itinerary": {
"oneOf": [
"anyOf": [
{ "$ref": "https://schemas.maas.global/core/itinerary.json" },
{ "$ref": "https://schemas.maas.global/core/itineraryV2.json" }
]
Expand Down
2 changes: 1 addition & 1 deletion maas-schemas/schemas/maas-backend/products/provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
},
"fixedFareCurrency": {
"description": "The currency of the maximum fixed fare",
"oneOf": [
"anyOf": [
{
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/currency"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "object",
"properties": {
"plan": {
"oneOf": [{ "$ref": "#/definitions/plan1" }, { "$ref": "#/definitions/plan2" }]
"anyOf": [{ "$ref": "#/definitions/plan1" }, { "$ref": "#/definitions/plan2" }]
}
},
"definitions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
]
},
"data": {
"oneOf": [
"anyOf": [
{
"type": "object",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"$ref": "https://schemas.maas.global/core/components/common.json#/definitions/agencyId"
},
"payload": {
"oneOf": [
"anyOf": [
{
"type": "object",
"description": "Query by radius",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"required": ["type", "number", "expiryMonth", "expiryYear", "cvv"]
},
"newPaymentMethod": {
"oneOf": [
"anyOf": [
{ "$ref": "#/definitions/stripePaymentMethod" },
{ "$ref": "#/definitions/creditCardPaymentMethod" }
]
Expand Down
Loading

0 comments on commit 97a9390

Please sign in to comment.