-
Notifications
You must be signed in to change notification settings - Fork 279
Replace JsonSchema with OpenApiSchema #1787
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
Conversation
This reverts commit 6d32cc1.
…ookups in the component registry
# Conflicts: # src/Microsoft.OpenApi/Models/OpenApiSchema.cs
…ookups in the component registry
…ft/OpenAPI.NET into mk/use-json-schema-model
| ExternalResource = externalResource | ||
| }; | ||
|
|
||
| Reference = _reference; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor
| foreach (var kvp in anyObject) | ||
| { | ||
| foreach (var detail in results.Details) | ||
| var key = kvp.Key; | ||
| context.Enter(key); | ||
|
|
||
| if (schema.Properties != null && | ||
| schema.Properties.TryGetValue(key, out var property)) | ||
| { | ||
| if (detail.Errors != null && detail.Errors.Any()) | ||
| { | ||
| foreach (var error in detail.Errors) | ||
| { | ||
| if (!string.IsNullOrEmpty(error.Key) || !string.IsNullOrEmpty(error.Value.Trim())) | ||
| { | ||
| context.CreateWarning(ruleName, string.Format("{0} : {1} at {2}", error.Key, error.Value.Trim(), detail.InstanceLocation)); | ||
| } | ||
| } | ||
| } | ||
| ValidateDataTypeMismatch(context, ruleName, anyObject[key], property); | ||
| } | ||
| else | ||
| { | ||
| ValidateDataTypeMismatch(context, ruleName, anyObject[key], schema.AdditionalProperties); | ||
| } | ||
|
|
||
| context.Exit(); | ||
| } |
Check notice
Code scanning / CodeQL
Missed opportunity to use Select
|




This PR:
JsonSchema.NETlibrary from the core and Readers projectJsonSchemaobject fromJsonSchema.NETwith our nativeOpenApiSchemaimplementation that supports all V2, V3, and V31-specific keywords.pattern propertieskeyword in line with JSON schema.exampleskeyword in theOpenApiSchemaobject in line with JSON schema as theexampleproperty has been deprecated in favor of it.$refto$idby:idas a locator when registering schemas in the registry and performing lookups during reference resolution.OpenApiSchemaReferenceobject that acts as a proxy for lazy schema reference resolutionJsonNodein place ofOpenApiAnyfor Enums and ExamplesIssues resolved
#1789
#1790
#1791
#1792
#1793