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:
@@ -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
|
||||
@@ -14,27 +14,32 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
/// A type that represents a product that uses the ``Client`` client.
|
||||
/// A representation of the product information used to generate the `User-Agent` header for requests to the Discogs API.
|
||||
///
|
||||
/// The Discogs API requires a `User-Agent` header that identifies the application making the request. This model captures
|
||||
/// the product name, version, and URL needed to build that header via the ``UserAgentMiddleware``.
|
||||
///
|
||||
/// The generated `User-Agent` header follows the format: `ProductName/1.0.0 +https://example.com`
|
||||
public struct Product: Sendable {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
/// A camel-cased name of a product.
|
||||
/// The camel-cased name of the product (e.g., `MyDiscogsApp`).
|
||||
let name: String
|
||||
|
||||
/// A URI link related to a product.
|
||||
/// A URI link related to the product (e.g., `https://example.com`).
|
||||
let url: String
|
||||
|
||||
/// A semantic version of a product.
|
||||
/// The semantic version of the product (e.g., `1.0.0`).
|
||||
let version: String
|
||||
|
||||
// MARK: Initializers
|
||||
|
||||
/// Initializes this model.
|
||||
/// - Parameters:
|
||||
/// - name: A camel-cased name of a product.
|
||||
/// - version: A semantic version of a product.
|
||||
/// - url: A URI link related to a product.
|
||||
/// - name: The camel-cased name of the product.
|
||||
/// - version: The semantic version of the product, following [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).
|
||||
/// - url: A URI link related to the product.
|
||||
public init(
|
||||
name: String,
|
||||
version: String,
|
||||
|
||||
Reference in New Issue
Block a user