skohub-io / skohub-editor

Apache License 2.0
5 stars 4 forks source link

Context isn't automatically added anymore #50

Closed acka47 closed 3 years ago

acka47 commented 3 years ago

With the PR at https://github.com/dini-ag-kim/lrmi-profile/pull/16, the context wasn't automatically embedded anymore although there still is a default set like this:

      "default": {
        "@context": [
          "https://w3id.org/kim/lrmi-profile/draft/context.jsonld"
        ]
      }

I also added the definitions object in the schema and oneOf in this PR. Maybe that is the problem.

acka47 commented 3 years ago

It looks like the problem is definitions and/or oneOf. The schema version where I only adjusted the context bit is working as expected, see https://skohub.io/editor/?schema=https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/ed3bf3196108cd48814d237e162c8062e44db15f/draft/schemas/schema.json

literarymachine commented 3 years ago

It looks like the problem is definitions and/or oneOf.

Yes, the top level oneOf is the problem here. It isn't that trivial to properly support oneOf different object types in the UI, and there is some merging of schemas going on in Builder that are most likely causing trouble here and that I won't be able to look into.

Alas, oneOf is not necessary for your schema, it actually makes things more complicated than they should be. See https://github.com/dini-ag-kim/lrmi-profile/pull/20 for a fix.

acka47 commented 3 years ago

Fixed with https://github.com/dini-ag-kim/lrmi-profile/commit/6452adb5704962e7fbf0ccc8ab0e03944555a3ff. Closing.