open-feature / flagd-schemas

Schemas and spec files pertaining to flagd
https://buf.build/open-feature/flagd
Apache License 2.0
6 stars 13 forks source link

Register JSON Schema in the Schema Store #19

Closed beeme1mr closed 1 year ago

beeme1mr commented 2 years ago

Schema Store is a collection of JSON schemas that are automatically loaded in supported IDEs. This would make editing flagD configurations easier because it would automatically perform basic validation and autocomplete functionality.

james-milligan commented 1 year ago

Ive looked into how we can implement this, and its going to be relatively simple:

we only need to add the following to the json catalogue as we will want to self host the schema (for our go package export):

    {
      "name": "OpenFeature Flag Configuration",
      "description": "OpenFeature flag configuration file",
      "fileMatch": [ "*.ffconfig.json" ],
      "url": "https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json",
      "versions": {
        "0.2.8": "https://github.com/open-feature/schemas/blame/v0.2.8/json/flagd-definitions.json"
      },
    },

I will open a pull request for this to be merged into the schema store, follow up actions will involve improving the ci for the repository to introduce unit tests, as we will be unable to use the inbuilt schema store tests (they are only available if the schema is to be hosted within the schema store)

I could use some input for an appropriate fileMatch regex, it is currently set to "*.ffconfig.json", this will be used to apply out linting to .json files within a project

cc @beeme1mr @toddbaert @Kavindu-Dodan @skyerus

james-milligan commented 1 year ago

we should also arrive at a consensus with regards to decoupling the spec from flagd, e.g. renaming the schema to flag-definitions and updating object titles and descriptions

beeme1mr commented 1 year ago

Can we make the file path *.flagd.json and *.flagd.yaml?

james-milligan commented 1 year ago

Can we make the file path *.flagd.json and *.flagd.yaml?

sure

beeme1mr commented 1 year ago

And *.flagd.yml

beeme1mr commented 1 year ago

The schema store has been updated.