Skip to content

Commit

Permalink
Update Semantic-and-Model-Violations-Reference.md (#12199)
Browse files Browse the repository at this point in the history
Adding secret_property code, update some other codes.
  • Loading branch information
raych1 authored Dec 28, 2020
1 parent 17644ec commit 34c2f7e
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions documentation/Semantic-and-Model-Violations-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ This document lists the set of automated rules that can be validated against swa
| [INVALID_RESPONSE_CODE](#INVALID_RESPONSE_CODE) | |
| [INVALID_RESPONSE_BODY](#INVALID_RESPONSE_BODY) | |
| [MISSING_REQUIRED_PARAMETER](#MISSING_REQUIRED_PARAMETER) | |
| [KEYWORD_TYPE_EXPECTED](#KEYWORD_TYPE_EXPECTED) | |
| [READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST](#READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST) | |
| [SCHEMA_VALIDATION_FAILED](#SCHEMA_VALIDATION_FAILED) | |
| [SECRET_PROPERTY](#SECRET_PROPERTY) | |
| [DISCRIMINATOR_VALUE_NOT_FOUND](#DISCRIMINATOR_VALUE_NOT_FOUND) | |
| [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) |
Expand Down Expand Up @@ -359,14 +359,6 @@ This document lists the set of automated rules that can be validated against swa

**How to fix the violation**: The error info has the position of swagger, look for the position in swagger and fix the value type of keyword.

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

**Output Message**: Keyword '{0}' is expected to be of type '{1}'.

**Description**: The value of the keyword in swagger should be the specific type.

**How to fix the violation**: Fix the value type of keyword.

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

**Output Message**: String does not match pattern {0}: {1}.
Expand Down Expand Up @@ -547,9 +539,9 @@ This document lists the set of automated rules that can be validated against swa

**Output Message**: This operation does not have a defined {0} response code.

**Description**: There's extra response code defined in example file.
**Description**: The specified response code is not defined in example file.

**How to fix the violation**: Remove extra response code definition in example or correct it.
**How to fix the violation**: Add response code to default, or add response code definition in the swagger.

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

Expand All @@ -559,15 +551,6 @@ This document lists the set of automated rules that can be validated against swa

**How to fix the violation**: Add response body.


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

**Output Message**: Keyword 'type' is expected to be of type 'array,boolean,integer,number,null,object,string'.

**Description**: According to Json schema spec, the allowed value for [type](http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.1) is 'array,boolean,integer,number,null,object,string'.

**How to fix the violation**: Set the value of type to one of the values above.

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

**Output Message**: Additional properties not allowed:{0}.
Expand Down Expand Up @@ -801,6 +784,14 @@ This document lists the set of automated rules that can be validated against swa

**How to fix the violation**: Remove this definition if it's not used.

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

**Output Message**: Secret property {0} cannot be sent in the response.

**Description**: The secret is not allowed to return in response when it's annotated with x-ms-secret:true.

**How to fix the violation**: Remove this secret value from the response.


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

Expand All @@ -826,4 +817,4 @@ This document lists the set of automated rules that can be validated against swa

**Description**: The property was not in the PUT request, but it is returned in the subsequent GET response. This implies that the property is read-only or has a default value.

**How to fix the violation**: If the property is a read-only, update the swagger definition for this property to mark it as "readOnly": true. Alternatively, keep the property in the GET schema but remove it from the PUT schema. If the property has a default value, update the Swagger definition for this property to mark it with "default": <default value> annotation.
**How to fix the violation**: If the property is a read-only, update the swagger definition for this property to mark it as "readOnly": true. Alternatively, keep the property in the GET schema but remove it from the PUT schema. If the property has a default value, update the Swagger definition for this property to mark it with "default": <default value> annotation.

0 comments on commit 34c2f7e

Please sign in to comment.