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

Minor fixes to sync Plecos schemas with OEP-8 version 0.3 #18

Closed
ttmc opened this issue Jun 4, 2019 · 1 comment · Fixed by #20
Closed

Minor fixes to sync Plecos schemas with OEP-8 version 0.3 #18

ttmc opened this issue Jun 4, 2019 · 1 comment · Fixed by #20

Comments

@ttmc
Copy link
Contributor

ttmc commented Jun 4, 2019

These are minor fixes to bring the Plecos schema files more in sync with OEP-8 version 0.3. (There were some big changes in OEP-8 version 0.4, mainly adding the "services" array. Those changes aren't included in this issue.)

In plecos/plecos/schemas/metadata_local_v0_4.json

  • Remove the overall checksum (not the file checksums). There should be no overall checksum in the local metadata because the overall checksum depends on the did and that is not known until later (after going through the register/publish flow).
  • The price should have a "pattern" to restrict it to being digits, e.g ^[0-9]+$. I don't know if we want to allow scientific notation such as "1.3E10" or "1.23E+9". If yes, then the regular expression would be a bit different.
  • In "links" - "items", "additionalProperties" is false but it should be true: OEP-8 gives marketplaces the freedom to add additional properties to link objects.

In plecos/plecos/schemas/metadata_remote_v0_4.json

  • In file objects, the contentType is required (according to OEP-8).
  • The overall checksum should be a string starting with "0x" and ending with 64 hex characters. Change the "pattern" regular expression from ^(.*)$ to ^0x[a-fA-F0-9]{64}$
  • datePublished is required in the remote base object.
  • See the local metadata task for the "pattern" on price (above).
  • See the local metadata task for the "additionalProperties" of links (above).

More "patterns" (regular expressions) could be added. I just put some of the more important ones above.

@ttmc ttmc changed the title Minor fixes to sync with OEP-8 version 0.3 Minor fixes to sync Plecos schemas with OEP-8 version 0.3 Jun 4, 2019
@ttmc
Copy link
Contributor Author

ttmc commented Jun 4, 2019

To construct and test regular expressions, I find https://regex101.com/ very helpful.

ttmc added a commit that referenced this issue Jun 4, 2019
eruizgar91 pushed a commit that referenced this issue Jun 4, 2019
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

Successfully merging a pull request may close this issue.

1 participant