Visitar URL original
Publicly available JSON schema to validate a JSON configuration file. · Issue #247 · revapi/revapi · GitHub
Skip to content

Publicly available JSON schema to validate a JSON configuration file. #247

Open

Description

@aivinog1

Hi!

I already see that there already exist schemas for configuration: https://github.com/revapi/revapi/tree/main/revapi-basic-features/src/main/resources/META-INF. But I can't find the basic configuration schema, that I can use to validate configs. It would be perfect if such schema will be available at Schema Store.

Activity

  1. metlos commented on Sep 14, 2021

    @metlos
    Member

    Hmm... this is an interesting idea, but this would require the schema files to be versioned somehow. Right now they are just embedded within the jar files of appropriate version. If they were external, they would have to be versioned independently and I am not sure it is worth the trouble.

    Would the https://revapi.org/revapi-maven-plugin/0.14.3/_attachments/validate-configuration-mojo.html maven goal suffice for your usecase? E.g.:

    mvn revapi:validate-configuration
    

    This goal actually uses the schema files and validates the individual config pieces against them. The error reporting is probably not the best in class, but it's at least something :)

  2. aivinog1 commented on Sep 15, 2021

    @aivinog1
    Author

    Hi @metlos. Of course, I'm using this goal quite often to verify this configuration, but it is much more convenient to validate against a schema in an IDE (Intellij IDEA for example) :)

  3. metlos commented on Sep 15, 2021

    @metlos
    Member

    This kind of uber schema could theoretically work if I could make the schema of the configuration element conditional on the value of the extension. This is doable (since draft-7 of json schema) but then we would again run into the problem of versioning the schema files. That could actually kinda work if we massaged the schema files during the release process and make them available on the site.

    But even with all of this, we could only cover schemas of extensions that are co-developed with Revapi. External extensions (granted, I don't know of many) wouldn't be able to participate in this.

    Nevertheless, this is an interesting proposition. I personally am ATM occupied with other more pressing problems (namely performance of the java analysis) but if you'd like to help out, I would certainly try to help you get started.

  4. aivinog1 commented on Sep 21, 2021

    @aivinog1
    Author

    Hey @metlos. Sorry for this long reply, I guess I could take this issue, but right now I'm pretty busy. So I'll return at this within the month or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions