SAP / abap-file-formats

File formats that define and specify the file representation for ABAP development objects
MIT License
58 stars 56 forks source link

Allow validation of JSON examples for `formatVersion != 1` #502

Closed albertmink closed 1 year ago

albertmink commented 1 year ago

Needed here https://github.com/SAP/abap-file-formats/pull/501

larshp commented 1 year ago

and the ABAP generation of the schemas might need adjusting plus an approach for creating the schemas (I have an example with handling two versions in one schema somewhere)

larshp commented 1 year ago

https://github.com/larshp/json-versioning

albertmink commented 1 year ago

JSON data/example validation fixed in https://github.com/SAP/abap-file-formats/commit/6a8246a2db0a46de5b5ff6d97b01ca109b462a49

albertmink commented 1 year ago

FYI: Schemastore does provide a fileMatch and optional version

      "name": ".agripparc.json",
      "description": "JSON schema for the Agrippa config file",
      "fileMatch": [".agripparc.json", "agripparc.json"],
      "url": "https://json.schemastore.org/agripparc-1.4.json",
      "versions": {
        "1.2": "https://json.schemastore.org/agripparc-1.2.json",
        "1.3": "https://json.schemastore.org/agripparc-1.3.json",
        "1.4": "https://json.schemastore.org/agripparc-1.4.json"

in https://github.com/SchemaStore/schemastore/blob/3047e784d9e34d88c821caeaad539a31d1957a04/src/api/json/catalog.json#L44-L51

Don't know if this can be adopted for the vs code extension. AFAIK, this is not supported in the package.json file, see autocompletion Screenshot 2023-03-02 at 14 36 04

albertmink commented 1 year ago

As a note: VS code extension of schemastore does validate against latest version number, see fileMatch

"url": "https://json.schemastore.org/agripparc-1.4.json",
"fileMatch": [
  ".agripparc.json",
  "agripparc.json"
]

https://github.com/remcohaszing/vscode-schemastore/blob/78a836013281154e550b43f6af4d5342278238c8/package.json#L112-L115

albertmink commented 1 year ago

continue here https://github.com/SAP/abap-file-formats/issues/508 As the validation based on GitHub actions was the initial reason for this issue and has been fixed.