Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniqueness not guaranteed if the same ref is used in multiple data files #54

Open
dmartinol opened this issue Jul 13, 2023 · 0 comments

Comments

@dmartinol
Copy link

Consider the following customer-schema:

"$schema": /metaschema-1.json
version: '1.0'
type: object

additionalProperties: false
properties:
...
  admin-user:
    "$ref": "/common-1.json#/definitions/crossref"
    "$schemaRef": "/admin-user-schema.yaml"
...

And the related admin-user-schema:

"$schema": /metaschema-1.json
version: '1.0'
type: object

additionalProperties: false
properties:
...
  email:
    type: string
    format: email
  username:
    type: string
...

Then in graphql schema define uniqueness of the email field:

- name: "AdminUser_v1"
  fields:
...
    - { name: email, type: string, isRequired: true, isUnique: true }
...

The uniqueness is not guaranteed if two documents with customer-schema are sharing the same admin-user configuration, as in:

$schema: "/customer-schema.yaml"
...
admin-user:
  "$ref": "/admin-user-1.yaml"
...

The uniqueness is only guaranteed if they all have their own admin-user document

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant