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

Replace JsonSchema with OpenApiSchema #1787

Merged
merged 47 commits into from
Aug 27, 2024

Conversation

MaggieKimani1
Copy link
Contributor

@MaggieKimani1 MaggieKimani1 commented Aug 20, 2024

This PR:

  • Uninstalls JsonSchema.NET library from the core and Readers project
  • Refactors the entire codebase by replacing the JsonSchema object from JsonSchema.NET with our native OpenApiSchema implementation that supports all V2, V3, and V31-specific keywords.
  • Adds support for pattern properties keyword in line with JSON schema.
  • Adds support for the examples keyword in the OpenApiSchema object in line with JSON schema as the example property has been deprecated in favor of it.
  • Enables local and external document dereferencing using JSON pointer to component as well as $ref to $id by:
    • Refactoring component registry to use id as a locator when registering schemas in the registry and performing lookups during reference resolution.
    • Creating an OpenApiSchemaReference object that acts as a proxy for lazy schema reference resolution
  • Refactors to use JsonNode in place of OpenApiAny for Enums and Examples
  • Adds tests for validation and refactors existing tests.

Issues resolved
#1789
#1790
#1791
#1792
#1793

# Conflicts:
#	src/Microsoft.OpenApi/Models/OpenApiSchema.cs
@MaggieKimani1 MaggieKimani1 marked this pull request as draft August 20, 2024 14:47
@MaggieKimani1 MaggieKimani1 marked this pull request as ready for review August 27, 2024 08:33
Copy link

sonarcloud bot commented Aug 27, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
74.9% Coverage on New Code (required ≥ 80%)
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@MaggieKimani1 MaggieKimani1 merged commit 4fdd0e8 into release/2.0.0 Aug 27, 2024
8 of 9 checks passed
@MaggieKimani1 MaggieKimani1 deleted the mk/use-json-schema-model branch August 27, 2024 13:41
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.

2 participants