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

Discussion: Ceramic namespace in JSON schemas #88

Open
PaulLeCam opened this issue Mar 1, 2021 · 0 comments
Open

Discussion: Ceramic namespace in JSON schemas #88

PaulLeCam opened this issue Mar 1, 2021 · 0 comments

Comments

@PaulLeCam
Copy link
Contributor

PaulLeCam commented Mar 1, 2021


cip: 88
title: Ceramic namespace in JSON schemas
author: Paul Le Cam (@PaulLeCam)
status: Draft
category: Standards
type: RFC
created: 2021-03-01

Simple Summary

Define a standard extension point for Ceramic-specific metadata in a JSON schema.

Abstract

This CIP defines a reserved namespace for Ceramic-specific metadata in a JSON schema, along with a reference table for standard uses of this namespace.

Motivation

As commented in #82 (comment) the $id cannot be used to define Ceramic-specific extensions as intended in CIP-82, so creating a custom namespace for Ceramic-specific metadata should be a safer option to enable further extensions.

Specification

Namespace

A JSON schema property can contain a $ceramic field, that must be an object with a unique type defined in the following reference table, for example:

{
  type: 'string',
  maxLength: 150,
  $ceramic: {
    type: 'tile',
    schema: '<schema docID or commitID>' ,
  },
}

Reference table

Type CIP Status
tile DocID json-schema definition Draft

Rationale

Using the $ceramic property should be consistent with other $-prefixed metadata properties in JSON schemas, avoiding possible conflicts with other property names.

A unique type, along with possible type-specific additional properties, should make it easy to add custom extensions and build tools (simple checks for existence of $ceramic property and type-specific logic, TypeScript interfaces and inference, etc.).

Finally, providing a reference table in this CIP should allow for easy discovery and avoid conflicts between extensions.

Backwards Compatibility

CIP-82 and CIP-85 will get updated to this new format.

Implementation

None yet.

Security Considerations

None I'm aware of.

Copyright

Copyright and related rights waived via CC0.

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

No branches or pull requests

1 participant