From c0f5f5f439ce6152ff3c078f9ba02f2549b2b58c Mon Sep 17 00:00:00 2001 From: tianxchen-ms <403562789@qq.com> Date: Fri, 5 Nov 2021 12:53:26 +0800 Subject: [PATCH] add new error type DISCRIMINATOR_PROPERTY_TYPE_NOT_STRING (#16676) Co-authored-by: Tianxiang Chen --- documentation/Semantic-and-Model-Violations-Reference.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/documentation/Semantic-and-Model-Violations-Reference.md b/documentation/Semantic-and-Model-Violations-Reference.md index fec8b898d4ee..70574ac32615 100644 --- a/documentation/Semantic-and-Model-Violations-Reference.md +++ b/documentation/Semantic-and-Model-Violations-Reference.md @@ -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) | @@ -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". +### 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. + ### DISCRIMINATOR_NOT_REQUIRED