-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port docs tests to new integration test style
- Loading branch information
Showing
8 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
46 changes: 46 additions & 0 deletions
46
...tests/integration/snapshots/schemars/tests/integration/docs.rs~doc_comments_enum.ser.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"title": "This is the enum's title", | ||
"description": "This is \n the enum's description.", | ||
"oneOf": [ | ||
{ | ||
"type": "string", | ||
"enum": [ | ||
"UndocumentedUnit", | ||
"UndocumentedUnit2" | ||
] | ||
}, | ||
{ | ||
"description": "This comment is included in the generated schema :)", | ||
"type": "string", | ||
"const": "DocumentedUnit" | ||
}, | ||
{ | ||
"title": "Complex variant", | ||
"description": "This is a struct-like variant.", | ||
"type": "object", | ||
"properties": { | ||
"Complex": { | ||
"type": "object", | ||
"properties": { | ||
"my_nullable_string": { | ||
"title": "A nullable string", | ||
"description": "This field is a nullable string.\n\n This\nis\n the second\n line!\n\n\n\n\n And this is the third!", | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"my_nullable_string" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"Complex" | ||
], | ||
"additionalProperties": false | ||
} | ||
] | ||
} |
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
...s/integration/snapshots/schemars/tests/integration/docs.rs~doc_comments_override.ser.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"title": "OverrideDocs struct", | ||
"description": "New description", | ||
"type": "object", | ||
"properties": { | ||
"my_int": { | ||
"title": "My integer", | ||
"description": "This is an i32", | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"my_undocumented_bool": { | ||
"type": "boolean" | ||
}, | ||
"my_documented_bool": { | ||
"title": "Documented bool", | ||
"description": "CAPITALIZED", | ||
"type": "boolean" | ||
} | ||
}, | ||
"required": [ | ||
"my_int", | ||
"my_undocumented_bool", | ||
"my_documented_bool" | ||
] | ||
} |
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
...sts/integration/snapshots/schemars/tests/integration/docs.rs~doc_comments_struct.ser.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"title": "This is the struct's title", | ||
"description": "This is the struct's description.", | ||
"type": "object", | ||
"properties": { | ||
"my_int": { | ||
"title": "An integer", | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"my_undocumented_bool": { | ||
"type": "boolean" | ||
}, | ||
"my_unit": { | ||
"description": "A unit struct instance", | ||
"$ref": "#/$defs/MyUnitStruct" | ||
}, | ||
"my_documented_bool": { | ||
"title": "Documented bool", | ||
"description": "This bool is documented", | ||
"type": "boolean" | ||
} | ||
}, | ||
"required": [ | ||
"my_int", | ||
"my_undocumented_bool", | ||
"my_unit", | ||
"my_documented_bool" | ||
], | ||
"$defs": { | ||
"MyUnitStruct": { | ||
"title": "A Unit", | ||
"type": "null" | ||
} | ||
} | ||
} |