Skip to content

Commit

Permalink
remove jsonschema fallback implementations. fix code that used old co…
Browse files Browse the repository at this point in the history
…ntent type argument to Encoding constructor
  • Loading branch information
mattpolzin committed Jul 20, 2024
1 parent 3d66657 commit d11fe0c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ extension OpenAPI.Content.Encoding: ExternallyDereferenceable {
}

let newEncoding = OpenAPI.Content.Encoding(
contentType: contentType,
contentTypes: contentTypes,
headers: newHeaders,
style: style,
explode: explode,
Expand Down
16 changes: 0 additions & 16 deletions Sources/OpenAPIKit/Schema Object/JSONSchemaContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,6 @@ public protocol JSONSchemaContext {
var vendorExtensions: [String: AnyCodable] { get }
}

extension JSONSchemaContext {

// TODO: Remove the default implementations of the following in v4 of OpenAPIKit.
// They are only here to make their addition non-breaking.

// 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 }

// Default implementation to make addition non-breaking
public var anchor: String? { nil }

// Default implementation to make addition non-breaking
public var dynamicAnchor: String? { nil }
}

extension JSONSchema {
/// The context that applies to all schemas.
public struct CoreContext<Format: OpenAPIFormat>: JSONSchemaContext, HasWarnings {
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenAPIKitCompat/Compat30To31.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ extension OpenAPIKit30.OpenAPI.Parameter.SchemaContext: To31 {
extension OpenAPIKit30.OpenAPI.Content.Encoding: To31 {
fileprivate func to31() -> OpenAPIKit.OpenAPI.Content.Encoding {
OpenAPIKit.OpenAPI.Content.Encoding(
contentType: contentType,
contentTypes: [contentType].compactMap { $0 },
headers: headers?.mapValues(eitherRefTo31),
style: style,
explode: explode,
Expand Down

0 comments on commit d11fe0c

Please sign in to comment.