Skip to content
Snippets Groups Projects
Commit fc9b2700 authored by Andreas Huber's avatar Andreas Huber
Browse files

CR-1: Discriminator hinzufügen

parent df2bf918
No related branches found
No related tags found
1 merge request!9Version 0.5
...@@ -8,10 +8,21 @@ ...@@ -8,10 +8,21 @@
{ {
"$ref": "../common/address-national.json" "$ref": "../common/address-national.json"
}, },
{
"$ref": "../common/address-postbox.json"
},
{ {
"$ref": "../common/address-international.json" "$ref": "../common/address-international.json"
} }
], ],
"discriminator": {
"propertyName": "type",
"mapping": {
"national": "../common/address-national.json",
"postbox": "../common/address-postbox.json",
"international": "../common/address-international.json"
}
},
"description": "Physikalische (Post-)Adresse" "description": "Physikalische (Post-)Adresse"
}, },
"telephone": { "telephone": {
......
{ {
"title": "Applicant Organisation",
"type": "object", "type": "object",
"title": "Applicant Organisation",
"description": "Antragsteller in Form von einer Organisation, z.B. einem Unternehmen", "description": "Antragsteller in Form von einer Organisation, z.B. einem Unternehmen",
"additionalProperties": false,
"properties": { "properties": {
"identifier": { "identifier": {
"type": "array", "type": "array",
...@@ -57,10 +58,21 @@ ...@@ -57,10 +58,21 @@
{ {
"$ref": "../common/address-national.json" "$ref": "../common/address-national.json"
}, },
{
"$ref": "../common/address-postbox.json"
},
{ {
"$ref": "../common/address-international.json" "$ref": "../common/address-international.json"
} }
], ],
"discriminator": {
"propertyName": "type",
"mapping": {
"national": "../common/address-national.json",
"postbox": "../common/address-postbox.json",
"international": "../common/address-international.json"
}
},
"description": "Offizielle Adresse" "description": "Offizielle Adresse"
}, },
"legalRepresentatives": { "legalRepresentatives": {
...@@ -84,6 +96,15 @@ ...@@ -84,6 +96,15 @@
"required": [ "required": [
"method" "method"
] ]
},
"type": {
"type": "string",
"enum": [
"organization"
]
} }
} },
"required": [
"type"
]
} }
\ No newline at end of file
{ {
"title": "Applicant Person",
"type": "object", "type": "object",
"title": "Applicant Person",
"description": "Antragstellerdaten für eine natürliche Person", "description": "Antragstellerdaten für eine natürliche Person",
"additionalProperties": false,
"properties": { "properties": {
"identifier": { "identifier": {
"type": "array", "type": "array",
...@@ -18,64 +19,15 @@ ...@@ -18,64 +19,15 @@
}, },
"contactInfo": { "contactInfo": {
"$ref": "./applicant-contact-info.json" "$ref": "./applicant-contact-info.json"
},
"type": {
"type": "string",
"enum": [
"person"
]
} }
}, },
"x-examples": { "required": [
"example-1": { "type"
"identifier": [ ]
{
"id": "918",
"schemeName": "Antragsportal",
"schemeId": "urn:com:example:antragsportal:user"
}
],
"contactInfo": {
"physicalAddress": {
"street": "Kurzer Weg",
"houseNumber": 7,
"postalCode": "12345",
"city": "string",
"addressSupplement": "string"
},
"telephone": [
{
"number": "+49 89 32168-42",
"mobile": true,
"description": "string"
}
],
"electronicAddresses": [
{
"channelType": "Service-Account-Mailbox",
"address": "string"
}
]
},
"identityInfo": {
"gender": "m",
"nationality": "string",
"familyName": "string",
"givenName": "string",
"birthName": "string",
"doctoralDegrees": "string",
"artisticName": "string",
"dateOfBirth": "2020-04-16",
"placeOfBirth": "string",
"placeOfResidence": {
"street": "string",
"houseNumber": null,
"houseNumberSuffix": "st",
"postalCode": "strin",
"city": "string",
"addressSupplement": "string"
}
},
"authentificationInfo": {
"timestamp": "2020-04-16T06:50:39Z",
"authentificationToken": {},
"authentificationMethod": "string",
"assuranceLevel": "low"
}
}
}
} }
\ No newline at end of file
{ {
"title": "Applicant",
"description": "Ein Antragsteller, entweder eine Organisation oder eine natürliche Person",
"oneOf": [ "oneOf": [
{ {
"$ref": "./applicant-person.json" "$ref": "./applicant-person.json"
...@@ -7,6 +9,11 @@ ...@@ -7,6 +9,11 @@
"$ref": "./applicant-organization.json" "$ref": "./applicant-organization.json"
} }
], ],
"title": "Applicant", "discriminator": {
"description": "Ein Antragsteller, entweder eine Organisation oder eine natürliche Person" "propertyName": "type",
"mapping": {
"person": "./applicant-person.json",
"organization": "./applicant-organization.json"
}
}
} }
\ No newline at end of file
...@@ -3,6 +3,22 @@ ...@@ -3,6 +3,22 @@
"title": "International Address", "title": "International Address",
"description": "Eine internationale Adresse, bestehend aus ein bis fünf Adresszeilen.", "description": "Eine internationale Adresse, bestehend aus ein bis fünf Adresszeilen.",
"additionalProperties": false, "additionalProperties": false,
"x-examples": {
"example-1": {
"lines": [
"760 United Nations Plaza",
"Manhattan, New York City, New York 10017"
],
"country": "368"
},
"example-2": {
"lines": [
"Threadneedle Street",
"London EC2R 8AH"
],
"country": "168"
}
},
"properties": { "properties": {
"lines": { "lines": {
"type": "array", "type": "array",
...@@ -20,26 +36,17 @@ ...@@ -20,26 +36,17 @@
"minLength": 3, "minLength": 3,
"maxLength": 3, "maxLength": 3,
"pattern": "^[0-9]{3}$" "pattern": "^[0-9]{3}$"
},
"type": {
"type": "string",
"enum": [
"international"
]
} }
}, },
"required": [ "required": [
"lines", "lines",
"country" "country",
], "type"
"x-examples": { ]
"example-1": {
"lines": [
"760 United Nations Plaza",
"Manhattan, New York City, New York 10017"
],
"country": "368"
},
"example-2": {
"lines": [
"Threadneedle Street",
"London EC2R 8AH"
],
"country": "168"
}
}
} }
\ No newline at end of file
...@@ -9,79 +9,57 @@ ...@@ -9,79 +9,57 @@
"city": "Ankh-Morpork" "city": "Ankh-Morpork"
} }
}, },
"oneOf": [ "type": "object",
{ "additionalProperties": false,
"additionalProperties": false, "properties": {
"properties": { "street": {
"street": { "type": "string",
"type": "string", "description": "Straße",
"description": "Straße", "maxLength": 55
"maxLength": 55 },
}, "houseNumber": {
"houseNumber": { "type": [
"type": [ "string",
"string", "integer"
"integer" ],
], "description": "Hausnummer",
"description": "Hausnummer", "maxLength": 9,
"maxLength": 9, "pattern": "^[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?$",
"pattern": "^[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?$", "minimum": 1
"minimum": 1 },
}, "houseNumberSuffix": {
"houseNumberSuffix": { "type": "string",
"type": "string", "description": "Hausnummerzusatz",
"description": "Hausnummerzusatz", "maxLength": 2,
"maxLength": 2, "pattern": "^[\\p{L}0-9. ]*$"
"pattern": "^[\\p{L}0-9. ]*$" },
}, "postalCode": {
"postalCode": { "type": "string",
"type": "string", "description": "Postleitzahl",
"description": "Postleitzahl", "minLength": 5,
"minLength": 5, "maxLength": 5,
"maxLength": 5, "pattern": "^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$"
"pattern": "^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$"
},
"city": {
"type": "string",
"description": "Ort",
"maxLength": 50
},
"addressSupplement": {
"type": "string",
"description": "Adresszusatz"
}
},
"required": [
"street",
"postalCode",
"city"
]
}, },
{ "city": {
"additionalProperties": false, "type": "string",
"properties": { "description": "Ort",
"postOfficeBox": { "maxLength": 50
"type": "string", },
"description": "Postfach" "addressSupplement": {
}, "type": "string",
"postalCode": { "description": "Adresszusatz"
"type": "string", },
"description": "Postleitzahl", "type": {
"minLength": 5, "type": "string",
"maxLength": 5, "enum": [
"pattern": "^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$" "national"
},
"city": {
"type": "string",
"description": "Ort",
"maxLength": 50
}
},
"required": [
"postalCode",
"city"
] ]
} }
], },
"type": "object" "required": [
"street",
"postalCode",
"city",
"type"
]
} }
\ No newline at end of file
{
"title": "Postfach Address",
"description": "Eine Adresse eines Postfachs.",
"x-examples": {
"example-1": {
"street": "Kurzer Weg",
"houseNumber": 7,
"postalCode": "12345",
"city": "Ankh-Morpork"
}
},
"type": "object",
"additionalProperties": false,
"properties": {
"postOfficeBox": {
"type": "string",
"description": "Postfach"
},
"postalCode": {
"type": "string",
"description": "Postleitzahl",
"minLength": 5,
"maxLength": 5,
"pattern": "^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$"
},
"city": {
"type": "string",
"description": "Ort",
"maxLength": 50
},
"type": {
"type": "string",
"enum": [
"postbox"
]
}
},
"required": [
"postalCode",
"city",
"type"
]
}
\ No newline at end of file
...@@ -40,12 +40,23 @@ ...@@ -40,12 +40,23 @@
"description": "Adresse als Alternative (Choice) von nationaler und internationaler Adresse.", "description": "Adresse als Alternative (Choice) von nationaler und internationaler Adresse.",
"oneOf": [ "oneOf": [
{ {
"$ref": "../common/address-national.json" "$ref": "./address-national.json"
}, },
{ {
"$ref": "../common/address-international.json" "$ref": "./address-postbox.json"
},
{
"$ref": "./address-international.json"
} }
] ],
"discriminator": {
"propertyName": "type",
"mapping": {
"national": "./address-national.json",
"postbox": "./address-postbox.json",
"international": "./address-international.json"
}
}
}, },
"identifiers": { "identifiers": {
"type": "array", "type": "array",
......
...@@ -40,10 +40,21 @@ ...@@ -40,10 +40,21 @@
{ {
"$ref": "./common/address-national.json" "$ref": "./common/address-national.json"
}, },
{
"$ref": "./common/address-postbox.json"
},
{ {
"$ref": "./common/address-international.json" "$ref": "./common/address-international.json"
} }
] ],
"discriminator": {
"propertyName": "type",
"mapping": {
"national": "./common/address-national.json",
"postbox": "./common/address-postbox.json",
"international": "./common/address-international.json"
}
}
}, },
"identifiers": { "identifiers": {
"type": "array", "type": "array",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment