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

Define Schema interface #311

Closed
tim-evans opened this issue Nov 25, 2019 · 1 comment
Closed

Define Schema interface #311

tim-evans opened this issue Nov 25, 2019 · 1 comment

Comments

@tim-evans
Copy link
Collaborator

As a kickoff of #183, let's have a discussion of how schemas should be structured.

In the branch that I created, the schema interface looks like:

interface SchemaDefinition {
  type: string;
  version: string;
  annotations: {
    [key: string]: typeof Annotation;
  }
}

The other option here is the most minimal approach, which is an annotation lookup table:

interface SchemaDefinition {
  [key: string]: typeof Annotation;
}

Before we start writing this, we want to solicit some feedback and ensure that we understand requirements that we may want on this.

Some general questions:

  • We've made a "content negotiation framework" to support dynamic markdown fetching so we don't need to optimistically write migrations. Do we want to add some friendly hooks here to handle this more easily?
  • We've had some discussions around versioning, and was wondering if it made sense for the version of the schema to be computed by the hash of the annotations included in the document.
  • How do we handle code that currently does lookups via strings? Should we require type to retain this behaviour, or should we sunset that pattern?

@bachbui, @colinarobinson, @blaine have all contributed to this discussion prior to this issue being opened
❤️ Thank you ❤️

@tim-evans
Copy link
Collaborator Author

We are going forward with:

interface SchemaDefinition {
  annotations: {
    [key: string]: typeof Annotation;
  }
}

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