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

Schema / Document how to introduce jsonSchema annotation type constraints in user-space. #2726

Conversation

suddenlyGiovanni
Copy link
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

This PR tries to address the points discussed in #2663;

Context

The outcome of the discussion and decision in n2663 is that @effect/schema will not extend nor maintain its internal typings for JSONSchema7. Instead, it will push such responsibility to the user space; the reasons are sound, and you can explore them by following the discussion.

However, it has also been decided to update the docs to showcase one possible technique and provide an example of how to achieve the same results that n2663 aimed to solve (better type safety and improved DX).

Changes

The README.md file in the schema package has been updated to provide detailed guidance on managing type constraints when dealing with non-standard extensions via the jsonSchema property. The update includes a code example demonstrating how to apply type constraints using the @types/json-schema package for TypeScript definitions.

Related

The `README.md` file in the schema package has been updated to provide
detailed guidance on managing type constraints when dealing with
non-standard extensions via the `jsonSchema` property. The update
includes a code example demonstrating how to apply type constraints
using the `@types/json-schema` package for TypeScript definitions.

Signed-off-by: Giovanni Ravalico <15946771+suddenlyGiovanni@users.noreply.github.com>
Copy link

changeset-bot bot commented May 10, 2024

⚠️ No Changeset found

Latest commit: cdfa12a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@suddenlyGiovanni suddenlyGiovanni changed the title docs(schema): document how to introduce jsonSchema type constraints Schema / Document how to introduce jsonSchema annotation type constraints in user-space. May 10, 2024
@suddenlyGiovanni suddenlyGiovanni marked this pull request as ready for review May 10, 2024 19:54
Copy link
Contributor

@gcanti gcanti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suddenlyGiovanni thanks! (no need for a changeset in this case, you can remove it)

Signed-off-by: Giovanni Ravalico <15946771+suddenlyGiovanni@users.noreply.github.com>
@gcanti gcanti merged commit 50b8bd5 into Effect-TS:main May 11, 2024
1 check passed
@suddenlyGiovanni suddenlyGiovanni deleted the schema/document-json-schema-type-annotation branch May 14, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants