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

feat: add format validation #1820

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

feat: add format validation #1820

wants to merge 4 commits into from

Conversation

tatomyr
Copy link
Contributor

@tatomyr tatomyr commented Dec 10, 2024

What/Why/How?

Added JSON Schema format validation.

Reference

Resolves #766

Related: #386

Testing

  • Add an e2e test.
  • Test in the browser env

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

@tatomyr tatomyr requested review from a team as code owners December 10, 2024 10:45
Copy link

changeset-bot bot commented Dec 10, 2024

🦋 Changeset detected

Latest commit: b004a0b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@redocly/openapi-core Minor
@redocly/cli Minor

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

github-actions bot commented Dec 10, 2024

Command Mean [ms] Min [ms] Max [ms] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 979.5 ± 12.8 957.7 995.5 1.00
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 994.8 ± 16.6 961.6 1016.1 1.02 ± 0.02

Copy link
Contributor

github-actions bot commented Dec 10, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.63% 5049/6421
🟡 Branches 67.28% 2056/3056
🟡 Functions 73.13% 833/1139
🟡 Lines 78.92% 4763/6035

Test suite run success

835 tests passing in 120 suites.

Report generated by 🧪jest coverage report action from b004a0b

.changeset/angry-taxis-share.md Outdated Show resolved Hide resolved
@tatomyr tatomyr marked this pull request as draft December 10, 2024 18:45
@jeremyfiel
Copy link
Contributor

while most of these are valid format assertions, just for future reference, the package ajv-formats was created for JSON Schema Draft-07, only. There may be additional formats available in future versions of JSON Schema, which are associated with OAS 3.1.x's use of JSON Schema 2020-12.

Also of note, OAS 3.x.0 depends on JSON Schema Draft-04, which does not define some of the formats used in later versions, such as Draft-07 or later.

@tatomyr
Copy link
Contributor Author

tatomyr commented Jan 17, 2025

Thanks for the clarification @jeremyfiel. I'm still testing this solution.

@tatomyr tatomyr force-pushed the feat/add-format-validation branch from 9e82900 to 29ead12 Compare January 23, 2025 09:57
@tatomyr tatomyr added the snapshot Create experimental release PR label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snapshot Create experimental release PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate the format of examples
3 participants