@@ -262,6 +262,13 @@ public class OpenApiSchema : IOpenApiExtensible, IOpenApiReferenceable, IOpenApi
262
262
/// </summary>
263
263
public OpenApiAny Example { get ; set ; }
264
264
265
+ /// <summary>
266
+ /// A free-form property to include examples of an instance for this schema.
267
+ /// To represent examples that cannot be naturally represented in JSON or YAML,
268
+ /// a list of values can be used to contain the examples with escaping where necessary.
269
+ /// </summary>
270
+ public IList < JsonNode > Examples { get ; set ; }
271
+
265
272
/// <summary>
266
273
/// Follow JSON Schema definition: https://tools.ietf.org/html/draft-fge-json-schema-validation-00
267
274
/// </summary>
@@ -362,6 +369,7 @@ public OpenApiSchema(OpenApiSchema schema)
362
369
AdditionalProperties = schema ? . AdditionalProperties != null ? new ( schema ? . AdditionalProperties ) : null ;
363
370
Discriminator = schema ? . Discriminator != null ? new ( schema ? . Discriminator ) : null ;
364
371
Example = schema ? . Example != null ? new ( schema ? . Example . Node ) : null ;
372
+ Examples = schema ? . Examples != null ? new List < JsonNode > ( schema . Examples ) : null ;
365
373
Enum = schema ? . Enum != null ? new List < JsonNode > ( schema . Enum ) : null ;
366
374
Nullable = schema ? . Nullable ?? Nullable ;
367
375
ExternalDocs = schema ? . ExternalDocs != null ? new ( schema ? . ExternalDocs ) : null ;
@@ -587,6 +595,7 @@ internal void WriteV31Properties(IOpenApiWriter writer)
587
595
writer . WriteProperty ( OpenApiConstants . V31ExclusiveMaximum , V31ExclusiveMaximum ) ;
588
596
writer . WriteProperty ( OpenApiConstants . V31ExclusiveMinimum , V31ExclusiveMinimum ) ;
589
597
writer . WriteProperty ( OpenApiConstants . UnevaluatedProperties , UnevaluatedProperties , false ) ;
598
+ writer . WriteOptionalCollection ( OpenApiConstants . Examples , Examples , ( nodeWriter , s ) => nodeWriter . WriteAny ( new OpenApiAny ( s ) ) ) ;
590
599
}
591
600
592
601
/// <summary>
0 commit comments