GfSE / SpecIF

Specification Integration Facility - schema, constraint checker and examples
Apache License 2.0
15 stars 6 forks source link

Include $schema property in each SpecIF file #36

Closed oalt closed 4 years ago

oalt commented 4 years ago

Hello @odungern !

In my IDE there is an example of a JSON configuration file where at the beginning a property "$schema" with a schema reference is included.

Example:

{
  "$schema": "http://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:60827",
      "sslPort": 44393
    }
  }, ...

What do you think - should we include such a property in each SpecIF file as well?

odungern commented 4 years ago

Indeed, that's only logical. Our schema states it's schema, as well.

Here, we have an example, where the schema has an extension *.json. In other cases, there is no extension. This is a detail, but perhaps the situation to reconsider this question.

odungern commented 4 years ago

Related issues:

odungern commented 4 years ago

Thanks, oalt for bringing up the topic. It is the 'dot on the i' (as we say in German) for v1.0!

odungern commented 4 years ago

I propose:

    "$schema": {
      "type": "string",
      "format": "uri",
      "pattern": "^https?:\\/\\/(specif\\.de\\/v1\\.0\\/schema|.+\\/specif-1\\.0)\\.json$",
      "description": "An absolute URL pointing to this SpecIF schema."
    },

The first option points firmly at our own server, the second would allow to reference a schema hosted on schemastore.org.

odungern commented 4 years ago

With respect to extension .json or not. On schemastore.org:

Following my guts, I would do like json-schema.org, but my experience does not like implicit knowledge in such cases, and so my proposal one step up does carry an extension ,,,

Your opinion @oalt @oeichmann @S-Ruesch ?

odungern commented 4 years ago

We could submit our schema here: SchemaStore at GitHub

odungern commented 4 years ago

... implemented according to proposal made above.