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":[{"type":"text","text":"A value of an identifier, if any."}],"schemaVersion":{"minor":3,"patch":0,"major":0},"identifier":{"url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/Identifier\/value","interfaceLanguage":"swift"},"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"value","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"},{"text":"?","kind":"text"}],"languages":["swift"]}]},{"kind":"content","content":[{"type":"heading","level":2,"text":"Discussion","anchor":"discussion"},{"type":"aside","style":"note","name":"Remark","content":[{"type":"paragraph","inlineContent":[{"text":"Generated from ","type":"text"},{"type":"codeVoice","code":"#\/components\/schemas\/Identifier\/value"},{"text":".","type":"text"}]}]}]}],"sections":[],"kind":"symbol","hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/Identifier"]]},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/components\/schemas\/identifier\/value"]}],"metadata":{"roleHeading":"Instance Property","role":"symbol","title":"value","modules":[{"name":"DiscogsService"}],"externalID":"s:14DiscogsService10ComponentsO7SchemasO10IdentifierV5valueSSSgvp","symbolKind":"property","fragments":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"value","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"},{"text":"?","kind":"text"}]},"references":{"doc://DiscogsService/documentation/DiscogsService/Components/Schemas/Identifier":{"abstract":[{"text":"A type that represents an identifier.","type":"text"}],"fragments":[{"text":"struct","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"Identifier"}],"url":"\/documentation\/discogsservice\/components\/schemas\/identifier","title":"Components.Schemas.Identifier","role":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/Identifier","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"Identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Components/Schemas":{"role":"symbol","type":"topic","abstract":[{"type":"text","text":"Types generated from the "},{"code":"#\/components\/schemas","type":"codeVoice"},{"text":" section of the OpenAPI document.","type":"text"}],"kind":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas","url":"\/documentation\/discogsservice\/components\/schemas","navigatorTitle":[{"text":"Schemas","kind":"identifier"}],"title":"Components.Schemas","fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Schemas","kind":"identifier"}]},"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"},"doc://DiscogsService/documentation/DiscogsService/Components/Schemas/Identifier/value":{"title":"value","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/Identifier\/value","role":"symbol","kind":"symbol","type":"topic","url":"\/documentation\/discogsservice\/components\/schemas\/identifier\/value","fragments":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"value"},{"kind":"text","text":": "},{"preciseIdentifier":"s:SS","kind":"typeIdentifier","text":"String"},{"kind":"text","text":"?"}],"abstract":[{"type":"text","text":"A value of an identifier, if any."}]},"doc://DiscogsService/documentation/DiscogsService":{"role":"collection","title":"DiscogsService","kind":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService","abstract":[],"type":"topic","url":"\/documentation\/discogsservice"}}}
{"sections":[],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/Identifier"]]},"abstract":[{"type":"text","text":"A value of an identifier, if any."}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/components\/schemas\/identifier\/value"]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/Identifier\/value"},"kind":"symbol","schemaVersion":{"minor":3,"major":0,"patch":0},"metadata":{"externalID":"s:14DiscogsService10ComponentsO7SchemasO10IdentifierV5valueSSSgvp","role":"symbol","symbolKind":"property","roleHeading":"Instance Property","modules":[{"name":"DiscogsService"}],"fragments":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"value","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"},{"text":"?","kind":"text"}],"title":"value"},"primaryContentSections":[{"kind":"declarations","declarations":[{"languages":["swift"],"platforms":["macOS"],"tokens":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"value","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"},{"text":"?","kind":"text"}]}]},{"content":[{"anchor":"discussion","type":"heading","level":2,"text":"Discussion"},{"style":"note","name":"Remark","type":"aside","content":[{"inlineContent":[{"type":"text","text":"Generated from "},{"type":"codeVoice","code":"#\/components\/schemas\/Identifier\/value"},{"type":"text","text":"."}],"type":"paragraph"}]}],"kind":"content"}],"references":{"doc://DiscogsService/documentation/DiscogsService/Components/Schemas/Identifier/value":{"abstract":[{"type":"text","text":"A value of an identifier, if any."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/Identifier\/value","type":"topic","url":"\/documentation\/discogsservice\/components\/schemas\/identifier\/value","kind":"symbol","role":"symbol","fragments":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"value","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","preciseIdentifier":"s:SS","kind":"typeIdentifier"},{"text":"?","kind":"text"}],"title":"value"},"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/Components/Schemas/Identifier":{"role":"symbol","title":"Components.Schemas.Identifier","kind":"symbol","type":"topic","abstract":[{"type":"text","text":"A type that represents an identifier."}],"navigatorTitle":[{"text":"Identifier","kind":"identifier"}],"url":"\/documentation\/discogsservice\/components\/schemas\/identifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/Identifier","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Identifier","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Components/Schemas":{"navigatorTitle":[{"text":"Schemas","kind":"identifier"}],"role":"symbol","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"Schemas"}],"title":"Components.Schemas","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas","abstract":[{"type":"text","text":"Types generated from the "},{"type":"codeVoice","code":"#\/components\/schemas"},{"type":"text","text":" section of the OpenAPI document."}],"type":"topic","url":"\/documentation\/discogsservice\/components\/schemas","kind":"symbol"},"doc://DiscogsService/documentation/DiscogsService":{"title":"DiscogsService","role":"collection","abstract":[],"kind":"symbol","type":"topic","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService","url":"\/documentation\/discogsservice"}}}