Skip to content

Commit

Permalink
add new error type DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING (Azure#16676)
Browse files Browse the repository at this point in the history
Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>
  • Loading branch information
tianxchen-ms and Tianxiang Chen authored Nov 5, 2021
1 parent 8fb0263 commit c0f5f5f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions documentation/Semantic-and-Model-Violations-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ This document lists the set of automated rules that can be validated against swa
| [SCHEMA_VALIDATION_FAILED](#SCHEMA_VALIDATION_FAILED) | |
| [SECRET_PROPERTY](#SECRET_PROPERTY) | |
| [DISCRIMINATOR_VALUE_NOT_FOUND](#DISCRIMINATOR_VALUE_NOT_FOUND) | |
| [DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING](#DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING) | [OAV132](#DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING) |
| [DISCRIMINATOR_NOT_REQUIRED](#DISCRIMINATOR_NOT_REQUIRED) | [OAV131](#DISCRIMINATOR_NOT_REQUIRED) |
| [RESPONSE_BODY_NOT_IN_EXAMPLE](#RESPONSE_BODY_NOT_IN_EXAMPLE) | [OAV130](#RESPONSE_BODY_NOT_IN_EXAMPLE) |
| [DOUBLE_FORWARD_SLASHES_IN_URL](#DOUBLE_FORWARD_SLASHES_IN_URL) | [OAV129](#DOUBLE_FORWARD_SLASHES_IN_URL) |
Expand Down Expand Up @@ -618,6 +619,14 @@ This document lists the set of automated rules that can be validated against swa

**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".

### <a name="DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING" />DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING

**Output Message**: The property type of discriminator must be string.

**Description**: If a property is declared as discriminator, the property type must be string and nothing else.

**How to fix the violation**: Set the property type to string in swagger.


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

Expand Down

0 comments on commit c0f5f5f

Please sign in to comment.