contentlayerdev / contentlayerdev/contentlayer

Leveraging JSON Schema

Open
#163 0 comments 1 reaction 0 assignees View on GitHub
feature
Dominant language
TypeScript
Stars
3.5k
Forks
192
PR merge metrics
No merged PRs in 30d

Description

The package relies today on its own schema definition in `defineDocumentType` for local content definition.

What I would like to ask if whether JSON Schema can be leveraged instead. The side effect is then that the schema definition is separate from the computed fields which is perhaps a good thing.

```js
import MyJsonSchema from 'myschema/test';

const Doc = defineDocumentType(() => ({
name: 'Doc',
filePathPattern: '**/*.md',
schema: MyJsonSchema,
computedFields: {
....
}
}))
```

The missing piece is that I don't know whether this impacts the architecture.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.