snowplow / iglu-server

A RESTful schema registry
Other
13 stars 9 forks source link

Validation service report error on invalid schema names #119

Closed istreeter closed 1 year ago

istreeter commented 1 year ago

See corresponding issue snowplow/schema-ddl#139

Currently, it is possible to publish an Iglu schema using a name with spaces:

{
    "$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
    "self": {
        "vendor": "com.example",
        "name": "this is a name with spaces",
        "format": "jsonschema",
        "version": "1-0-0"
    },
    "type": "object"
}

However, this schema is effectively unusable, because the resulting iglu uri cannot be parsed. When parsing a uri, Iglu has strict requirements on valid characters.

In Iglu Serer this change will be implemented by bumping schema-ddl to version 0.17.0.

istreeter commented 1 year ago

As a consequence of this change, Iglu Server will no longer return messages like self is unknown keyword for vanilla $schema, use http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#. Previously it issued this warning if a schema contained the self field but was missing the $schema field.

I think this is a good thing -- the old message wasn't very helpful, because it somehow implied that Iglu Server could be used for validating "vanilla" (non-self-describing) schemas. But actually Iglu Server can only be used for self-describing schemas, so self is always a required field.

Importantly, all schemas that returned errors in older versions of Iglu Server will still return errors after this change is merged. But the error messages will be more relevant.