Skip to content

Commit 8c17c14

Browse files
raych1josuh
authored andcommitted
Update Semantic-and-Model-Violations-Reference.md (Azure#12199)
Adding secret_property code, update some other codes.
1 parent bfc33ba commit 8c17c14

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

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

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ This document lists the set of automated rules that can be validated against swa
6161
| [INVALID_RESPONSE_CODE](#INVALID_RESPONSE_CODE) | |
6262
| [INVALID_RESPONSE_BODY](#INVALID_RESPONSE_BODY) | |
6363
| [MISSING_REQUIRED_PARAMETER](#MISSING_REQUIRED_PARAMETER) | |
64-
| [KEYWORD_TYPE_EXPECTED](#KEYWORD_TYPE_EXPECTED) | |
6564
| [READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST](#READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST) | |
6665
| [SCHEMA_VALIDATION_FAILED](#SCHEMA_VALIDATION_FAILED) | |
66+
| [SECRET_PROPERTY](#SECRET_PROPERTY) | |
6767
| [DISCRIMINATOR_VALUE_NOT_FOUND](#DISCRIMINATOR_VALUE_NOT_FOUND) | |
6868
| [DISCRIMINATOR_NOT_REQUIRED](#DISCRIMINATOR_NOT_REQUIRED) | [OAV131](#DISCRIMINATOR_NOT_REQUIRED) |
6969
| [RESPONSE_BODY_NOT_IN_EXAMPLE](#RESPONSE_BODY_NOT_IN_EXAMPLE) | [OAV130](#RESPONSE_BODY_NOT_IN_EXAMPLE) |
@@ -359,14 +359,6 @@ This document lists the set of automated rules that can be validated against swa
359359

360360
**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.
361361

362-
### <a name="KEYWORD_TYPE_EXPECTED" />KEYWORD_TYPE_EXPECTED
363-
364-
**Output Message**: Keyword '{0}' is expected to be of type '{1}'.
365-
366-
**Description**: The value of the keyword in swagger should be the specific type.
367-
368-
**How to fix the violation**: Fix the value type of keyword.
369-
370362
### <a name="PATTERN" />PATTERN
371363

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

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

550-
**Description**: There's extra response code defined in example file.
542+
**Description**: The specified response code is not defined in example file.
551543

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

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

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

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

562-
563-
### <a name="KEYWORD_TYPE_EXPECTED" />KEYWORD_TYPE_EXPECTED
564-
565-
**Output Message**: Keyword 'type' is expected to be of type 'array,boolean,integer,number,null,object,string'.
566-
567-
**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'.
568-
569-
**How to fix the violation**: Set the value of type to one of the values above.
570-
571554
### <a name="OBJECT_ADDITIONAL_PROPERTIES" />OBJECT_ADDITIONAL_PROPERTIES
572555

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

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

787+
### <a name="SECRET_PROPERTY" />SECRET_PROPERTY
788+
789+
**Output Message**: Secret property {0} cannot be sent in the response.
790+
791+
**Description**: The secret is not allowed to return in response when it's annotated with x-ms-secret:true.
792+
793+
**How to fix the violation**: Remove this secret value from the response.
794+
804795

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

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

827818
**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.
828819

829-
**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.
820+
**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 commit comments

Comments
 (0)