Skip to content

Commit

Permalink
Merge pull request #347 from mattpolzin/even-less-breaking-inferred-a…
Browse files Browse the repository at this point in the history
…ddition

even less breaking by supporting a default implementation of the new inferred property.
  • Loading branch information
mattpolzin authored Nov 13, 2023
2 parents cdcdb22 + d758f64 commit 7dbb3ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/OpenAPIKit/Schema Object/JSONSchemaContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ public protocol JSONSchemaContext {
var vendorExtensions: [String: AnyCodable] { get }
}

extension JSONSchemaContext {
// Default implementation to make addition of this new property which is only
// supposed to be set internally a non-breaking addition.
public var inferred: Bool { false }
}

extension JSONSchema {
/// The context that applies to all schemas.
public struct CoreContext<Format: OpenAPIFormat>: JSONSchemaContext, Equatable {
Expand Down
6 changes: 6 additions & 0 deletions Sources/OpenAPIKit30/Schema Object/JSONSchemaContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ public protocol JSONSchemaContext {
var deprecated: Bool { get }
}

extension JSONSchemaContext {
// Default implementation to make addition of this new property which is only
// supposed to be set internally a non-breaking addition.
public var inferred: Bool { false }
}

extension JSONSchema {
/// The context that applies to all schemas.
public struct CoreContext<Format: OpenAPIFormat>: JSONSchemaContext, Equatable {
Expand Down

0 comments on commit 7dbb3ce

Please sign in to comment.