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

Finalize schemas #78

Closed
sethvincent opened this issue Feb 16, 2023 · 5 comments
Closed

Finalize schemas #78

sethvincent opened this issue Feb 16, 2023 · 5 comments
Assignees

Comments

@sethvincent
Copy link
Contributor

We need to finalize the schemas for data types used in mapeo-core.

A partial list of schemas includes:

  • Observation
  • AuthStore
    • CoreOwnership
    • Device
    • Role
  • ConfigStore
    • DeviceInfo
    • ProjectInfo
    • (additional schemas for all project config, including categories, fields, etc.)

Related issue in mapeo-schema: https://github.com/digidem/mapeo-schema/issues/25

@ximenabb
Copy link

@gmaclennan

@tomasciccola
Copy link
Contributor

I think, in order to be done with schema design and be able to move on - and taking into account backwards compatibility - we should have a round of deep schema revision. I can create an issue for that but mostly entails maybe meeting and going through schemas and check for possible issues/shortcomings
@gmaclennan @sethvincent wdyt?

@tomasciccola
Copy link
Contributor

In here there's the mention of BlobStore schemas not yet defined. I couldn't find any reference on the blobstore branch regarding schemas. Should we takle this now?

@tomasciccola
Copy link
Contributor

I think, in order to be done with schema design and be able to move on - and taking into account backwards compatibility - we should have a round of deep schema revision. I can create an issue for that but mostly entails maybe meeting and going through schemas and check for possible issues/shortcomings @gmaclennan @sethvincent wdyt?

Going back to this, we should take the time to revise all the latests versions of schemas to see any nuances, missing or innecessary fields, better approaches, eetc..
Thinks I've noticed:

  • required fields doesn't seem to be inherited:
    i.e. Common JSONSchema has created_at as required but this doesn't seem to be checked on Field_2 automatically; we need to also add created_at as required on Field_2
  • additionalProperties doesn't seem to take "inherited" schemas.
    i.e. if Field_2 inherits from common (by using allOf: [{"$ref":"../common/v1.json"}]) but has additionalProperties set to false, validation of the schema will fail when you add fields that are 'inherited' from Common (like created_at)
  • Discrepancies when defining a field as a literal
    i.e. schemaType is always a literal (it must be Observation for example). In some schemas this is denoted as "pattern": "^Observation$" and in others as "enum":["Observation"]. We should choose only one approach for new record versions

@gmaclennan @achou11 maybe we should take some time to revised this in the following weeks? Probably a meeting where we go through every schema is a good staring point...

@gmaclennan
Copy link
Member

Split into smaller issues since this is a larger task:

  • digidem/mapeo-schema#69
  • digidem/mapeo-schema#70
  • digidem/mapeo-schema#64
  • digidem/mapeo-schema#68

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

No branches or pull requests

4 participants