Skip to content

Commit cf8f03e

Browse files
tianxchen-msTianxiang Chen
authored andcommitted
add new error type DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING (Azure#16676)
Co-authored-by: Tianxiang Chen <[email protected]>
1 parent 64a1018 commit cf8f03e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

documentation/Semantic-and-Model-Violations-Reference.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ This document lists the set of automated rules that can be validated against swa
6464
| [SCHEMA_VALIDATION_FAILED](#SCHEMA_VALIDATION_FAILED) | |
6565
| [SECRET_PROPERTY](#SECRET_PROPERTY) | |
6666
| [DISCRIMINATOR_VALUE_NOT_FOUND](#DISCRIMINATOR_VALUE_NOT_FOUND) | |
67+
| [DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING](#DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING) | [OAV132](#DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING) |
6768
| [DISCRIMINATOR_NOT_REQUIRED](#DISCRIMINATOR_NOT_REQUIRED) | [OAV131](#DISCRIMINATOR_NOT_REQUIRED) |
6869
| [RESPONSE_BODY_NOT_IN_EXAMPLE](#RESPONSE_BODY_NOT_IN_EXAMPLE) | [OAV130](#RESPONSE_BODY_NOT_IN_EXAMPLE) |
6970
| [DOUBLE_FORWARD_SLASHES_IN_URL](#DOUBLE_FORWARD_SLASHES_IN_URL) | [OAV129](#DOUBLE_FORWARD_SLASHES_IN_URL) |
@@ -618,6 +619,14 @@ This document lists the set of automated rules that can be validated against swa
618619

619620
**How to fix the violation**: Add the model that has the discriminator value or fix the discriminator value. The discriminator value could be specified by model name in definitions or by "x-ms-discriminator-value".
620621

622+
### <a name="DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING" />DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING
623+
624+
**Output Message**: The property type of discriminator must be string.
625+
626+
**Description**: If a property is declared as discriminator, the property type must be string and nothing else.
627+
628+
**How to fix the violation**: Set the property type to string in swagger.
629+
621630

622631
### <a name="DISCRIMINATOR_NOT_REQUIRED" />DISCRIMINATOR_NOT_REQUIRED
623632

0 commit comments

Comments
 (0)