Skip to content

Conversation

@tatomyr
Copy link
Collaborator

@tatomyr tatomyr commented Dec 10, 2024

What/Why/How?

Added JSON Schema format validation.

NB: use the same version of ajv-formats as in other products to avoid conflicts.

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
@changeset-bot
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

@github-actions
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

@github-actions
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

@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
Collaborator 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
@jeremyfiel
Copy link
Contributor

this draft pr was auto-merged with the snapshot label.

is this supposed to be included?

@tatomyr
Copy link
Collaborator Author

tatomyr commented Mar 31, 2025

is this supposed to be included?

That was only for testing purposes. Nothing was really merged. Please disregard that.

@tatomyr tatomyr mentioned this pull request Jul 14, 2025
8 tasks
@tatomyr
Copy link
Collaborator Author

tatomyr commented Jul 14, 2025

Closing it in favour of #2172.

@tatomyr tatomyr closed this Jul 14, 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

4 participants