-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Which JsonSchema version is used? Why is $schema not allwoed? #4455
Comments
@rufreakde Can you provide an example with the |
@nickgros I thought the example worked but somehow the schema references are gone maybe I did something wrong with the playground? I would need to modify my exporter I will come to it maybe in the upcoming days then I can post a full example. |
Okay crazy. It works now... I am very surprised. I should have screenshottet the error message! This was my test. {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Unit",
"type": "object",
"additionalProperties": false,
"properties": {
"Type": {
"type": "string"
},
"Path": {
"type": "string"
},
"Name": {
"type": "string"
},
"ProductionClass": {
"$ref": "#/definitions/ProductionClass"
},
"LuckModifier": {
"type": "integer",
"format": "int32"
},
"Movement": {
"$ref": "#/definitions/Movement"
},
"Armor": {
"$ref": "#/definitions/Armor"
},
"ArmorModifier": {
"type": "integer",
"format": "int32"
},
"PrimaryWeapon": {
"$ref": "#/definitions/Weapon"
},
"SecondaryWeapon": {
"$ref": "#/definitions/Weapon"
}
},
"definitions": {
"ProductionClass": {
"type": "string",
"description": "",
"x-enumNames": [
"Ground",
"Air",
"Water"
],
"enum": [
"Ground",
"Air",
"Water"
]
},
"Movement": {
"type": "object",
"additionalProperties": false,
"properties": {
"BaseMovement": {
"type": "integer",
"format": "int32"
},
"CanWalkDrive": {
"type": "boolean"
},
"CanSwim": {
"type": "boolean"
},
"CanFly": {
"type": "boolean"
},
"Weight": {
"type": "integer",
"format": "int32"
},
"Tires": {
"$ref": "#/definitions/TiresOrLegs"
}
}
},
"TiresOrLegs": {
"type": "string",
"description": "",
"x-enumNames": [
"RubberTires",
"Chains",
"HumanLegs",
"RoboticLegs",
"Hover",
"Fly"
],
"enum": [
"RubberTires",
"Chains",
"HumanLegs",
"RoboticLegs",
"Hover",
"Fly"
]
},
"Armor": {
"type": "string",
"description": "",
"x-enumNames": [
"LightInfantry",
"HeavyInfantry",
"LightVehicle",
"MediumVehicle",
"HeavyVehicle",
"SuperHeavyVehicle"
],
"enum": [
"LightInfantry",
"HeavyInfantry",
"LightVehicle",
"MediumVehicle",
"HeavyVehicle",
"SuperHeavyVehicle"
]
},
"Weapon": {
"type": "object",
"additionalProperties": false,
"properties": {
"Calibre": {
"$ref": "#/definitions/Calibre"
},
"BaseDamage": {
"type": "integer",
"format": "int32"
},
"canHitGround": {
"type": "boolean"
},
"canHitGroundSpecial": {
"type": "boolean"
},
"canHitAir": {
"type": "boolean"
},
"canHitAirSpecial": {
"type": "boolean"
}
}
},
"Calibre": {
"type": "string",
"description": "",
"x-enumNames": [
"Light",
"Medium",
"Heavy",
"SuperHeavy"
],
"enum": [
"Light",
"Medium",
"Heavy",
"SuperHeavy"
]
}
}
} |
Prerequisites
What theme are you using?
validator-ajv8
What is your question?
I am using c# to export some classes with a tool:
https://github.com/RicoSuter/NJsonSchema
Which seems to export with:
https://json-schema.org/draft-05
With a property within
I had to manually modify and delete
$schema
property.exampe
The text was updated successfully, but these errors were encountered: