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

Adds support for AJV Keywords + conditional schemas #8

Open
wants to merge 2 commits into
base: feat/esm
Choose a base branch
from

Conversation

dgilperez
Copy link
Collaborator

@dgilperez dgilperez commented May 18, 2022

Coming from #5, rebased on top of #7

This PR brings the current version I plan to use in production for a while to upstream:

  • Adds ajv-keywords with the comments from ajv-keywords
  • Support for conditionals on the schemas.

On the last one, the current implementation assumes the schema has a structure with a limited number of predefined of keywords (headers, body, query ...), but will not allow for conditionals such as if: and then: (see more here). That feature is particularly useful in a versioned API, if we want to maintain backwards compatibility without carrying too much schema weigh around.

I hope the test explains it well. The implementation is kind of simple, we may want to generalize it a bit.

@dgilperez dgilperez changed the base branch from feat/esm to master July 21, 2022 14:45
@dgilperez dgilperez changed the base branch from master to feat/esm July 21, 2022 15:43
@dgilperez
Copy link
Collaborator Author

@andreidmt I just can't make build work for me using swc. It seems I am facing some platform error, probably this one swc-project/swc#5616 (I am running on Mac, you're on Linux).

In particular, npx swc src -d dist fails with a large number of Fallback bindings does not support filesystem access. errors, once for each js file ...

No build, I can't run tests or develop more ... :(:(:(

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 this pull request may close these issues.

1 participant