Skip to content

Commit

Permalink
Merge branch 'main' into release/4_0
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin authored Oct 13, 2024
2 parents bfbc86f + cf31c5d commit c76e824
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
30 changes: 25 additions & 5 deletions Sources/OpenAPIKit/Validator/Validation+Builtins.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension Validation {
/// Validate the OpenAPI Document has at least one path in its
/// `PathItem.Map`.
///
/// The OpenAPI Specifcation does not require that the document
/// The OpenAPI Specification does not require that the document
/// contain any paths for [security reasons](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#security-filtering)
/// or even because it only contains webhooks, but authors may still
/// want to protect against an empty `PathItem.Map` in some cases.
Expand All @@ -29,7 +29,7 @@ extension Validation {
/// Validate the OpenAPI Document's `PathItems` all have at least
/// one operation.
///
/// The OpenAPI Specifcation does not require that path items
/// The OpenAPI Specification does not require that path items
/// contain any operations for [security reasons](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#security-filtering)
/// but documentation that is public in nature might only ever have
/// a `PathItem` with no operations in error.
Expand All @@ -45,7 +45,7 @@ extension Validation {
/// Validate the OpenAPI Document's `JSONSchemas` all have at least
/// one defining characteristic.
///
/// The JSON Schema Specifcation does not require that components
/// The JSON Schema Specification does not require that components
/// have any defining characteristics. An "empty" schema component can
/// be written as follows:
///
Expand Down Expand Up @@ -160,7 +160,7 @@ extension Validation {
/// Validate the OpenAPI Document's `Operations` all have at least
/// one response.
///
/// The OpenAPI Specifcation does not require that Responses Objects
/// The OpenAPI Specification does not require that Responses Objects
/// contain at least one response but you may wish to validate that all
/// operations contain at least one response in your own API.
///
Expand All @@ -182,7 +182,7 @@ extension Validation {

/// Validate that the OpenAPI Document's `Tags` all have unique names.
///
/// The OpenAPI Specifcation requires that tag names on the Document
/// The OpenAPI Specification requires that tag names on the Document
/// [are unique](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#openapi-object).
///
/// - Important: This is included in validation by default.
Expand Down Expand Up @@ -445,6 +445,16 @@ extension Validation {
)
}

/// Validate that `enum` must not be empty in the document's
/// Server Variable.
///
/// - Important: This is included in validation by default.
///
@available(*, deprecated, renamed: "serverVariableEnumIsValid")
public static var serverVarialbeEnumIsValid: Validation<OpenAPI.Server.Variable> {
return serverVariableEnumIsValid
}

/// Validate that `default` must exist in the enum values in the document's
/// Server Variable, if such values (enum) are defined.
///
Expand All @@ -459,6 +469,16 @@ extension Validation {
}
)
}

/// Validate that `default` must exist in the enum values in the document's
/// Server Variable, if such values (enum) are defined.
///
/// - Important: This is included in validation by default.
///
@available(*, deprecated, renamed: "serverVariableDefaultExistsInEnum")
public static var serverVarialbeDefaultExistsInEnum : Validation<OpenAPI.Server.Variable> {
return serverVariableDefaultExistsInEnum
}
}

/// Used by both the Path Item parameter check and the
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenAPIKit/Validator/Validator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ extension OpenAPI.Document {
/// `where` clause both examine the same type (i.e. `OpenAPI.Document.Info`
/// from the previous example and `OpenAPI.Document` from the next example).
///
/// The next example also uses `take()` in its `where` caluse. This allows you to
/// The next example also uses `take()` in its `where` clause. This allows you to
/// dig into a value based on its KeyPath just like the previous example but you can
/// use it for more complicated criteria than equality/inequality.
///
Expand Down

0 comments on commit c76e824

Please sign in to comment.