Skip to content

Commit 8f62e54

Browse files
committed
Revert "Add support for pattern properties"
This reverts commit 6d32cc1.
1 parent 6d32cc1 commit 8f62e54

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

src/Microsoft.OpenApi/Models/OpenApiSchema.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,6 @@ public class OpenApiSchema : IOpenApiExtensible, IOpenApiReferenceable, IOpenApi
227227
/// </summary>
228228
public IDictionary<string, OpenApiSchema> Properties { get; set; } = new Dictionary<string, OpenApiSchema>();
229229

230-
/// <summary>
231-
/// Follow JSON Schema definition: https://tools.ietf.org/html/draft-fge-json-schema-validation-00
232-
/// PatternProperty definitions MUST be a Schema Object and not a standard JSON Schema (inline or referenced)
233-
/// Each property name of this object SHOULD be a valid regular expression according to the ECMA 262 r
234-
/// egular expression dialect. Each property value of this object MUST be an object, and each object MUST
235-
/// be a valid Schema Object not a standard JSON Schema.
236-
/// </summary>
237-
public IDictionary<string, OpenApiSchema> PatternProperties { get; set; } = new Dictionary<string, OpenApiSchema>();
238-
239230
/// <summary>
240231
/// Follow JSON Schema definition: https://tools.ietf.org/html/draft-fge-json-schema-validation-00
241232
/// </summary>
@@ -372,12 +363,11 @@ public OpenApiSchema(OpenApiSchema schema)
372363
MinItems = schema?.MinItems ?? MinItems;
373364
UniqueItems = schema?.UniqueItems ?? UniqueItems;
374365
Properties = schema?.Properties != null ? new Dictionary<string, OpenApiSchema>(schema.Properties) : null;
375-
PatternProperties = schema?.PatternProperties != null ? new Dictionary<string, OpenApiSchema>(schema.PatternProperties) : null;
376366
MaxProperties = schema?.MaxProperties ?? MaxProperties;
377367
MinProperties = schema?.MinProperties ?? MinProperties;
378368
AdditionalPropertiesAllowed = schema?.AdditionalPropertiesAllowed ?? AdditionalPropertiesAllowed;
379369
AdditionalProperties = schema?.AdditionalProperties != null ? new(schema?.AdditionalProperties) : null;
380-
Discriminator = schema?.Discriminator != null ? new(schema?.Discriminator) : null;
370+
Discriminator = schema?.Discriminator != null ? new(schema?.Discriminator) : null;
381371
Example = schema?.Example != null ? new(schema?.Example.Node) : null;
382372
Examples = schema?.Examples != null ? new List<JsonNode>(schema.Examples) : null;
383373
Enum = schema?.Enum != null ? new List<JsonNode>(schema.Enum) : null;
@@ -606,7 +596,6 @@ internal void WriteV31Properties(IOpenApiWriter writer)
606596
writer.WriteProperty(OpenApiConstants.V31ExclusiveMinimum, V31ExclusiveMinimum);
607597
writer.WriteProperty(OpenApiConstants.UnevaluatedProperties, UnevaluatedProperties, false);
608598
writer.WriteOptionalCollection(OpenApiConstants.Examples, Examples, (nodeWriter, s) => nodeWriter.WriteAny(new OpenApiAny(s)));
609-
writer.WriteOptionalMap(OpenApiConstants.PatternProperties, PatternProperties, (w, s) => s.SerializeAsV31(w));
610599
}
611600

612601
/// <summary>

src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

44
using Microsoft.OpenApi.Extensions;
@@ -150,10 +150,6 @@ internal static partial class OpenApiV31Deserializer
150150
"properties",
151151
(o, n, t) => o.Properties = n.CreateMap(LoadOpenApiSchema, t)
152152
},
153-
{
154-
"patternProperties",
155-
(o, n, t) => o.PatternProperties = n.CreateMap(LoadOpenApiSchema, t)
156-
},
157153
{
158154
"additionalProperties", (o, n, _) =>
159155
{

0 commit comments

Comments
 (0)