참고소스 수정본
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"action": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"chosen_action": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fight",
|
||||
"flight"
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"chosen_action": { "const": "fight" }
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"weapon": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"weapon"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"chosen_action": { "const": "flight" }
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"flight_direction": {
|
||||
"type": "string"
|
||||
},
|
||||
"distance": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"distance"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"required": [
|
||||
"chosen_action"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"action"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"$defs": {
|
||||
"Fight": {
|
||||
"properties": {
|
||||
"chosen_action": {
|
||||
"const": "fight",
|
||||
"title": "Chosen Action",
|
||||
"type": "string"
|
||||
},
|
||||
"weapon": {
|
||||
"title": "Weapon",
|
||||
"type": "string",
|
||||
"validators": [
|
||||
{
|
||||
"rail_alias": "valid-choices"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"chosen_action",
|
||||
"weapon"
|
||||
],
|
||||
"title": "Fight",
|
||||
"type": "object"
|
||||
},
|
||||
"Flight": {
|
||||
"properties": {
|
||||
"chosen_action": {
|
||||
"const": "flight",
|
||||
"title": "Chosen Action",
|
||||
"type": "string"
|
||||
},
|
||||
"flight_direction": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"title": "Flight Direction",
|
||||
"validators": [
|
||||
{
|
||||
"rail_alias": "valid-choices"
|
||||
}
|
||||
]
|
||||
},
|
||||
"distance": {
|
||||
"title": "Distance",
|
||||
"type": "integer",
|
||||
"validators": [
|
||||
{
|
||||
"rail_alias": "valid-choices"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"chosen_action",
|
||||
"flight_direction",
|
||||
"distance"
|
||||
],
|
||||
"title": "Flight",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"action": {
|
||||
"discriminator": {
|
||||
"mapping": {
|
||||
"fight": "#/$defs/Fight",
|
||||
"flight": "#/$defs/Flight"
|
||||
},
|
||||
"propertyName": "chosen_action"
|
||||
},
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/$defs/Fight"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/Flight"
|
||||
}
|
||||
],
|
||||
"title": "Action"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"action"
|
||||
],
|
||||
"title": "FightOrFlight",
|
||||
"type": "object"
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"$defs": {
|
||||
"Fee": {
|
||||
"properties": {
|
||||
"index": {"title": "Index", "type": "integer", "format": "1-indexed"},
|
||||
"name": {"title": "Name", "type": "string"},
|
||||
"explanation": {"title": "Explanation", "type": "string"},
|
||||
"value": {"title": "Value", "type": "number", "format": "percentage"}
|
||||
},
|
||||
"required": ["index", "name", "explanation", "value"],
|
||||
"title": "Fee",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"fees": {
|
||||
"description": "What fees and charges are associated with my account?",
|
||||
"items": {"$ref": "#/$defs/Fee"},
|
||||
"title": "Fees",
|
||||
"type": "array"
|
||||
},
|
||||
"interest_rates": {
|
||||
"additionalProperties": {"type": "string"},
|
||||
"description": "What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?",
|
||||
"title": "Interest Rates",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["fees", "interest_rates"],
|
||||
"title": "CreditCardAgreement",
|
||||
"type": "object"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Some string..."
|
||||
}
|
||||
Reference in New Issue
Block a user