Open lachieh opened 1 year ago
In doing a bit more investigation, I believe there a some changes to the schema file that need to be made.
According to JSONSchema Draft 07, the additionalProperties
field on should be a fully valid JSONSchema on its own, but at the moment it looks like it is a list of properties. additionalProperties
is for validating extra keys of any name.
"type": "object"
, "required": []
and "additionalProperties": true
(this last one could be false to disallow extra fields on spec
though looking at other examples in the world, this would break compatibility)"properties"
object, and moving variables
, scopes
and components
inside this new objectspec.additionalProperties
spec.$ref
and set the value to "#/definitions/operationalConfigurationSpec"
Any input here? Would it be beneficial to recreate the JSON Schema file from the latest version of the spec?
I was recently experimenting with validating an OAM ApplicationConfiguration file and thought it best to use the actual schema to validate it. I'm using ajv to validate in the browser and I pulled the schema json file from this repo. When running a validation for the first time, I noticed that ajv was having a bit of difficulty parsing the schema. Specifically, it didn't know how to handle this section: https://github.com/oam-dev/spec/blob/e0991c5d0e666333ebbfa19f3490320bf671d8c0/schema/application_configuration.schema.json#L57-L81
Are the
variables
,scopes
andcomponents
supposed to be nested inside of aproperties
object? Making this change locally resolves the issue for ajv, though I'm not sure if this is an issue with the schema file's schema, or with ajv itself.Additionally, the $id is not a valid URI (it's missing a
/
after http:) though I'm not sure if this is critical.https://github.com/oam-dev/spec/blob/e0991c5d0e666333ebbfa19f3490320bf671d8c0/schema/application_configuration.schema.json#L3
I'm happy to contribute a PR with these changes.