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

Add JSON schema support #1766

Merged
merged 27 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cf27ffa
Add an OpenApiSchema model with known keywords
MaggieKimani1 Jul 25, 2024
6fed385
Add a copy constructor
MaggieKimani1 Jul 25, 2024
71215ac
Add an OpenApiSchema model with all known keywords
MaggieKimani1 Jul 29, 2024
3000226
Add V2 schema deserializer
MaggieKimani1 Jul 29, 2024
5d3580c
Add v31 schema property names as constants
MaggieKimani1 Jul 30, 2024
7761651
Add license info; implement IOpenApiReferenceable interface
MaggieKimani1 Jul 30, 2024
6bb2546
Add serialization logic
MaggieKimani1 Jul 30, 2024
f76fddf
clean up file
MaggieKimani1 Jul 30, 2024
5cfce6e
Add a V3 schema deserializer
MaggieKimani1 Jul 30, 2024
a124aa2
Make the host document an optional param
MaggieKimani1 Jul 30, 2024
0600002
Serialize type array in v31
MaggieKimani1 Jul 30, 2024
902bd62
Update namespace
MaggieKimani1 Jul 30, 2024
a59ba31
Remove unnecessary usings
MaggieKimani1 Jul 30, 2024
902936e
Add a v31 schema deserializer
MaggieKimani1 Jul 30, 2024
266896b
Update import, code cleanup
MaggieKimani1 Jul 30, 2024
536218c
Add null conditional operator
MaggieKimani1 Jul 30, 2024
2ffebe7
Update public API interface
MaggieKimani1 Jul 30, 2024
81b41e9
Write string value for Type for V2 and V3, allow type array for V3
MaggieKimani1 Aug 7, 2024
be9e5a2
code cleanup
MaggieKimani1 Aug 7, 2024
13d5061
Add schema loader
MaggieKimani1 Aug 7, 2024
ee2495f
if node value is string, get the scalar value, else cast it into an a…
MaggieKimani1 Aug 7, 2024
57ca1cc
Clean up type array support logic
MaggieKimani1 Aug 8, 2024
58e3cd6
Add tests and update public API
MaggieKimani1 Aug 8, 2024
4ff2176
clean up code block
MaggieKimani1 Aug 8, 2024
6f28adf
Use ternary operator
MaggieKimani1 Aug 8, 2024
f5811e9
Add support for pattern properties
MaggieKimani1 Aug 13, 2024
e09fe00
Update public API surface
MaggieKimani1 Aug 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions src/Microsoft.OpenApi/Models/OpenApiConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,66 @@ public static class OpenApiConstants
/// </summary>
public const string Format = "format";

/// <summary>
/// Field: Schema
/// </summary>
public const string DollarSchema = "$schema";

/// <summary>
/// Field: Id
/// </summary>
public const string Id = "$id";

/// <summary>
/// Field: Comment
/// </summary>
public const string Comment = "$comment";

/// <summary>
/// Field: Vocabulary
/// </summary>
public const string Vocabulary = "$vocabulary";

/// <summary>
/// Field: DynamicRef
/// </summary>
public const string DynamicRef = "$dynamicRef";

/// <summary>
/// Field: DynamicAnchor
/// </summary>
public const string DynamicAnchor = "$dynamicAnchor";

/// <summary>
/// Field: RecursiveRef
/// </summary>
public const string RecursiveRef = "$recursiveRef";

/// <summary>
/// Field: RecursiveAnchor
/// </summary>
public const string RecursiveAnchor = "$recursiveAnchor";

/// <summary>
/// Field: Definitions
/// </summary>
public const string Defs = "$defs";

/// <summary>
/// Field: V31ExclusiveMaximum
/// </summary>
public const string V31ExclusiveMaximum = "exclusiveMaximum";

/// <summary>
/// Field: V31ExclusiveMinimum
/// </summary>
public const string V31ExclusiveMinimum = "exclusiveMinimum";

/// <summary>
/// Field: UnevaluatedProperties
/// </summary>
public const string UnevaluatedProperties = "unevaluatedProperties";

/// <summary>
/// Field: Version
/// </summary>
Expand Down
Loading
Loading