Implemented the User Agent middleware (#6)

This PR contains the work done to implement the `UserAgentMiddleware` middleware that includes user agent information into a header of the requests sent by the `Client` type, as defined in the [Discogs documentation](https://www.discogs.com/developers/#page:home,header:home-general-information). For this purpose, the `CamelCaseValidationRule`, `SemanticVersionValidationRule` and `URLValidationRule` types were implemented and integrated into the existing `ValidateInputUseCase` type.

Reviewed-on: #6
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 #6.
This commit is contained in:
2025-10-13 00:54:17 +00:00
committed by Javier Cicchelli
parent 24d703b967
commit 791ebf4f78
1988 changed files with 2882 additions and 2010 deletions
@@ -1 +1 @@
{"abstract":[{"text":"An identifier of a label.","type":"text"}],"schemaVersion":{"patch":0,"minor":3,"major":0},"identifier":{"url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Parameters\/LabelId","interfaceLanguage":"swift"},"primaryContentSections":[{"kind":"declarations","declarations":[{"languages":["swift"],"platforms":["macOS"],"tokens":[{"text":"typealias","kind":"keyword"},{"text":" ","kind":"text"},{"text":"LabelId","kind":"identifier"},{"text":" = ","kind":"text"},{"text":"Int","preciseIdentifier":"s:Si","kind":"typeIdentifier"}]}]},{"kind":"content","content":[{"text":"Discussion","level":2,"type":"heading","anchor":"discussion"},{"style":"note","name":"Remark","type":"aside","content":[{"type":"paragraph","inlineContent":[{"text":"Generated from ","type":"text"},{"type":"codeVoice","code":"#\/components\/parameters\/LabelId"},{"text":".","type":"text"}]}]}]}],"sections":[],"kind":"symbol","hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Parameters"]]},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/components\/parameters\/labelid"]}],"metadata":{"roleHeading":"Type Alias","role":"symbol","title":"Components.Parameters.LabelId","navigatorTitle":[{"text":"LabelId","kind":"identifier"}],"modules":[{"name":"DiscogsService"}],"externalID":"s:14DiscogsService10ComponentsO10ParametersO7LabelIda","symbolKind":"typealias","fragments":[{"kind":"keyword","text":"typealias"},{"kind":"text","text":" "},{"kind":"identifier","text":"LabelId"}]},"references":{"doc://DiscogsService/documentation/DiscogsService":{"role":"collection","title":"DiscogsService","kind":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService","abstract":[],"type":"topic","url":"\/documentation\/discogsservice"},"doc://DiscogsService/documentation/DiscogsService/Components/Parameters":{"kind":"symbol","role":"symbol","url":"\/documentation\/discogsservice\/components\/parameters","navigatorTitle":[{"text":"Parameters","kind":"identifier"}],"title":"Components.Parameters","fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Parameters","kind":"identifier"}],"abstract":[{"type":"text","text":"Types generated from the "},{"code":"#\/components\/parameters","type":"codeVoice"},{"text":" section of the OpenAPI document.","type":"text"}],"type":"topic","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Parameters"},"doc://DiscogsService/documentation/DiscogsService/Components/Parameters/LabelId":{"fragments":[{"text":"typealias","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"LabelId"}],"abstract":[{"type":"text","text":"An identifier of a label."}],"type":"topic","title":"Components.Parameters.LabelId","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Parameters\/LabelId","role":"symbol","url":"\/documentation\/discogsservice\/components\/parameters\/labelid","navigatorTitle":[{"text":"LabelId","kind":"identifier"}],"kind":"symbol"},"doc://DiscogsService/documentation/DiscogsService/Components":{"title":"Components","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components","navigatorTitle":[{"text":"Components","kind":"identifier"}],"abstract":[{"type":"text","text":"Types generated from the components section of the OpenAPI document."}],"type":"topic","fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Components","kind":"identifier"}],"role":"symbol","url":"\/documentation\/discogsservice\/components","kind":"symbol"}}}
{"metadata":{"navigatorTitle":[{"text":"LabelId","kind":"identifier"}],"modules":[{"name":"DiscogsService"}],"externalID":"s:14DiscogsService10ComponentsO10ParametersO7LabelIda","role":"symbol","title":"Components.Parameters.LabelId","roleHeading":"Type Alias","symbolKind":"typealias","fragments":[{"text":"typealias","kind":"keyword"},{"text":" ","kind":"text"},{"text":"LabelId","kind":"identifier"}]},"kind":"symbol","hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Parameters"]]},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"typealias","kind":"keyword"},{"text":" ","kind":"text"},{"text":"LabelId","kind":"identifier"},{"text":" = ","kind":"text"},{"preciseIdentifier":"s:Si","text":"Int","kind":"typeIdentifier"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"content","content":[{"type":"heading","anchor":"discussion","level":2,"text":"Discussion"},{"type":"aside","name":"Remark","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Generated from "},{"type":"codeVoice","code":"#\/components\/parameters\/LabelId"},{"type":"text","text":"."}]}],"style":"note"}]}],"abstract":[{"type":"text","text":"An identifier of a label."}],"sections":[],"schemaVersion":{"patch":0,"major":0,"minor":3},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/components\/parameters\/labelid"]}],"identifier":{"url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Parameters\/LabelId","interfaceLanguage":"swift"},"references":{"doc://DiscogsService/documentation/DiscogsService/Components/Parameters/LabelId":{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Parameters\/LabelId","fragments":[{"text":"typealias","kind":"keyword"},{"text":" ","kind":"text"},{"text":"LabelId","kind":"identifier"}],"url":"\/documentation\/discogsservice\/components\/parameters\/labelid","type":"topic","role":"symbol","abstract":[{"type":"text","text":"An identifier of a label."}],"title":"Components.Parameters.LabelId","kind":"symbol","navigatorTitle":[{"text":"LabelId","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Components":{"role":"symbol","title":"Components","kind":"symbol","type":"topic","abstract":[{"type":"text","text":"Types generated from the components section of the OpenAPI document."}],"navigatorTitle":[{"kind":"identifier","text":"Components"}],"url":"\/documentation\/discogsservice\/components","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components","fragments":[{"kind":"keyword","text":"enum"},{"text":" ","kind":"text"},{"kind":"identifier","text":"Components"}]},"doc://DiscogsService/documentation/DiscogsService":{"title":"DiscogsService","role":"collection","abstract":[],"kind":"symbol","type":"topic","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService","url":"\/documentation\/discogsservice"},"doc://DiscogsService/documentation/DiscogsService/Components/Parameters":{"type":"topic","title":"Components.Parameters","navigatorTitle":[{"text":"Parameters","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Parameters","abstract":[{"text":"Types generated from the ","type":"text"},{"code":"#\/components\/parameters","type":"codeVoice"},{"text":" section of the OpenAPI document.","type":"text"}],"role":"symbol","url":"\/documentation\/discogsservice\/components\/parameters","fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Parameters","kind":"identifier"}],"kind":"symbol"}}}