parent
4b90b6f8c8
commit
1a40d1b06c
3 changed files with 15 additions and 1 deletions
|
@ -136,3 +136,11 @@ enum SoundOfMusic {
|
|||
fn enum_unit_with_doc_comments() -> TestResult {
|
||||
test_default_generated_schema::<SoundOfMusic>("enum-unit-doc")
|
||||
}
|
||||
|
||||
#[derive(JsonSchema)]
|
||||
enum NoVariants {}
|
||||
|
||||
#[test]
|
||||
fn enum_no_variants() -> TestResult {
|
||||
test_default_generated_schema::<NoVariants>("no-variants")
|
||||
}
|
||||
|
|
6
schemars/tests/expected/no-variants.json
Normal file
6
schemars/tests/expected/no-variants.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "NoVariants",
|
||||
"type": "string",
|
||||
"enum": []
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue