cardinalby / schema-validator-action

JSON Schema validator Action
MIT License
11 stars 2 forks source link

Support of external reference schema #3

Closed Nemric closed 2 years ago

Nemric commented 2 years ago

Hi, I use your action and it usually works great. I try to write schemas that are based on previous schema (for now only one) As you can see, schema 1.5 rely on schema 1.4 but your validation tool doesn't seem to use/found the $ref link here

Let me know if you want more details.

Thanks :)

cardinalby commented 2 years ago

Hi! I'm not an author of jsonschema library that performs validation. The action is just a wrapper around this library. Probably, you should ask the author of the library or advise me a better library to integrate with the action.

I'm not familiar with the syntax you use and as far as I know, JSON Schema doesn't support inheritance in this form that you try to implement. From my point of view, the best possible option is using "allOf": [{ "$ref": "https://github.com/Nemric/Butane-Schemas/releases/latest/download/butane-v1_4_0.json" }] instead.

Read also: https://github.com/json-schema-org/json-schema-spec/issues/348#issuecomment-322940347

Nemric commented 2 years ago

Thanks for answering :) I've to dig deeper in JSON schema and validations that seems to be different depending the implementation, I don't have any problems validating it with vscode (or at least, it doesn't return any errors) and works as expected. Your GHaction is a double check for me, that's fine to find errors that vscode doesn't complain about.

I understand that you use an external library, so that's not an issue for you ;)

Thanks