You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following properties are taken directly from the JSON Schema definition and follow the same specifications:
$ref - As a JSON Reference
format (See Data Type Formats for further details)
title
description (GFM syntax can be used for rich text representation)
default (Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object)
multipleOf
maximum
exclusiveMaximum
minimum
exclusiveMinimum
maxLength
minLength
pattern
maxItems
minItems
uniqueItems
maxProperties
minProperties
required
enum
type <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
An instance has one of six primitive types, and a range of possible values depending on the type:
null
A JSON "null" production
boolean
A "true" or "false" value, from the JSON "true" or "false" productions
object
An unordered set of properties mapping a string to an instance, from the JSON "object" production
array
An ordered list of instances, from the JSON "array" production
number
An arbitrary-precision, base-10 decimal number value, from the JSON "number" production
string
A string of Unicode code points, from the JSON "string" production
Whitespace and formatting concerns are thus outside the scope of JSON Schema.
Since an object cannot have two properties with the same key, behavior for a JSON document that tries to define two properties (the "member" production) with the same key (the "string" production) in a single object is undefined.
So 2 key takeaways for Autorest
"null" is a valid primitive type and Autorest should not fail.
type can either be a string or an array of unique strings (primitive types)
Swagger specification says
This is the definition of type as per the JSON schema draft 4
5.21. type
The value of this keyword MUST be either a string or an array. If it is an array, elements of the array MUST be strings and MUST be unique.
String values MUST be one of the seven primitive types defined by the core specification.
An instance matches successfully if its primitive type is one of the types defined by keyword. Recall: "number" includes "integer".
Primitive types supported by JSON schema.
These are the set of primitives supported by JSON schema.
An instance has one of six primitive types, and a range of possible values depending on the type:
A JSON "null" production
A "true" or "false" value, from the JSON "true" or "false" productions
An unordered set of properties mapping a string to an instance, from the JSON "object" production
An ordered list of instances, from the JSON "array" production
An arbitrary-precision, base-10 decimal number value, from the JSON "number" production
A string of Unicode code points, from the JSON "string" production
Whitespace and formatting concerns are thus outside the scope of JSON Schema.
Since an object cannot have two properties with the same key, behavior for a JSON document that tries to define two properties (the "member" production) with the same key (the "string" production) in a single object is undefined.
So 2 key takeaways for Autorest
Currently Autorest fails on both of them.
/cc @johanste @fearthecowboy @veronicagg @markcowl @hovsepm
The text was updated successfully, but these errors were encountered: