Documentation improvements (#16)

This PR contains the work done to improve the documentation efforts in the package, aiming at improving the documentation of the source code as well as the OpenAPI specification document. In addition, a breaking bug has been fixed.

Reviewed-on: #16
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #16.
This commit is contained in:
2026-03-24 01:22:53 +00:00
committed by Javier Cicchelli
parent a0672cc4af
commit b14a9fa816
35 changed files with 196 additions and 172 deletions
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -16,7 +16,7 @@ extension String {
/// An empty string.
static let empty = ""
/// A namespaces assigned for the names of parameters.
/// A namespace for the names of parameters.
enum Parameter {
/// A name for the consumer key.
static let key = "key"
@@ -25,9 +25,9 @@ extension String {
/// A name for the user token.
static let token = "token"
}
/// A namespaces assigned for the formats of string values.
/// A namespace for the formats of string values.
enum Format {}
/// A namespaces assigned for the formats of regular expression patterns.
/// A namespace for the formats of regular expression patterns.
enum Pattern {}
}
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -52,7 +52,7 @@ private extension CamelCaseValidationRule {
///
/// - Parameter input: An input to be validated.
/// - Returns: A flag that indicates whether a given input has been validated or not.
/// - Throws: An error of type ``InputValidatorError`` in case the validation failed.
/// - Throws: An error of type ``InputValidationError`` in case the validation failed.
func validate(input: String?) throws -> Bool {
guard let input else {
return false
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -52,7 +52,7 @@ private extension NotEmptyValidationRule {
///
/// - Parameter input: An input to be validated.
/// - Returns: A flag that indicates whether a given input has been validated or not.
/// - Throws: An error of type ``InputValidatorError`` in case the validation failed.
/// - Throws: An error of type ``InputValidationError`` in case the validation failed.
func validate(input: String?) throws -> Bool {
guard let input else {
return false
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -52,7 +52,7 @@ private extension NotNilValidationRule {
///
/// - Parameter input: An input to be validated.
/// - Returns: A flag that indicates whether a given input has been validated or not.
/// - Throws: An error of type ``InputValidatorError`` in case the validation failed.
/// - Throws: An error of type ``InputValidationError`` in case the validation failed.
func validate(input: String?) throws -> Bool {
guard input != nil else {
throw InputValidationError.inputIsNil
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -65,9 +65,9 @@ extension InputValidationRule where Self == SecureValidationRule {
enum SecurityInput: Int {
/// A consumer key is 20 characters long.
case consumerKey = 20
/// A consumer key is 32 characters long.
/// A consumer secret is 32 characters long.
case consumerSecret = 32
/// A consumer key is 40 characters long.
/// A user token is 40 characters long.
case userToken = 40
}
@@ -83,7 +83,7 @@ private extension SecureValidationRule {
///
/// - Parameter input: An input to be validated.
/// - Returns: A flag that indicates whether a given input has been validated or not.
/// - Throws: An error of type ``InputValidatorError`` in case the validation failed.
/// - Throws: An error of type ``InputValidationError`` in case the validation failed.
func validate(input: String?) throws -> Bool {
guard let input else {
return false
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -54,7 +54,7 @@ private extension SemanticVersionValidationRule {
///
/// - Parameter input: An input to be validated.
/// - Returns: A flag that indicates whether a given input has been validated or not.
/// - Throws: An error of type ``InputValidatorError`` in case the validation failed.
/// - Throws: An error of type ``InputValidationError`` in case the validation failed.
func validate(input: String?) throws -> Bool {
guard let input else {
return false
@@ -2,7 +2,7 @@
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
@@ -56,7 +56,7 @@ private extension URLValidationRule {
///
/// - Parameter input: An input to be validated.
/// - Returns: A flag that indicates whether a given input has been validated or not.
/// - Throws: An error of type ``InputValidatorError`` in case the validation failed.
/// - Throws: An error of type ``InputValidationError`` in case the validation failed.
func validate(input: String?) throws -> Bool {
guard let input else {
return false