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

Is it possible to get rid of schema? #708

Open
linonetwo opened this issue Jul 11, 2023 · 2 comments
Open

Is it possible to get rid of schema? #708

linonetwo opened this issue Jul 11, 2023 · 2 comments

Comments

@linonetwo
Copy link

This is not only a parser but also a serializer, which includes some JSONSchema validator, can we delete that if we can ensure JSON safety in our code? Ensure the json passed in is JSON.stringify able by ourself?

@linonetwo
Copy link
Author

linonetwo commented Jul 11, 2023

We are trying to further reduce the size. I've read the code, not sure if schema is not only for checking JSON is valid, but also work for building YAML AST, then we can't delete it.

There are 5 schemas, maybe we can delete FAILSAFE_SCHEMA and JSON_SCHEMA?

  exports.CORE_SCHEMA = CORE_SCHEMA;
  exports.DEFAULT_SCHEMA = DEFAULT_SCHEMA;
  exports.FAILSAFE_SCHEMA = FAILSAFE_SCHEMA;
  exports.JSON_SCHEMA = JSON_SCHEMA;
  exports.Schema = Schema$1;

@eternalphane
Copy link

There are 5 schemas, maybe we can delete FAILSAFE_SCHEMA and JSON_SCHEMA?

  exports.CORE_SCHEMA = CORE_SCHEMA;
  exports.DEFAULT_SCHEMA = DEFAULT_SCHEMA;
  exports.FAILSAFE_SCHEMA = FAILSAFE_SCHEMA;
  exports.JSON_SCHEMA = JSON_SCHEMA;
  exports.Schema = Schema$1;

YAML schema is different with JSON schema. The former is used to parse YAML document, while the latter is only used to validate JSON document.

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

No branches or pull requests

2 participants