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 @@
{"primaryContentSections":[{"kind":"declarations","declarations":[{"languages":["swift"],"tokens":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"join"}],"platforms":["macOS"]}]}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/components\/schemas\/artistid\/codingkeys\/join"]}],"schemaVersion":{"patch":0,"minor":3,"major":0},"kind":"symbol","identifier":{"interfaceLanguage":"swift","url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId\/CodingKeys\/join"},"metadata":{"fragments":[{"text":"case","kind":"keyword"},{"text":" ","kind":"text"},{"text":"join","kind":"identifier"}],"symbolKind":"case","modules":[{"name":"DiscogsService"}],"title":"Components.Schemas.ArtistId.CodingKeys.join","role":"symbol","roleHeading":"Case","externalID":"s:14DiscogsService10ComponentsO7SchemasO8ArtistIdV10CodingKeysO4joinyA2ImF"},"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId\/CodingKeys"]]},"sections":[],"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/Schemas/ArtistId":{"title":"Components.Schemas.ArtistId","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId","navigatorTitle":[{"kind":"identifier","text":"ArtistId"}],"abstract":[{"type":"text","text":"A type that references an artist."}],"type":"topic","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"ArtistId"}],"role":"symbol","url":"\/documentation\/discogsservice\/components\/schemas\/artistid","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"},"doc://DiscogsService/documentation/DiscogsService/Components/Schemas/ArtistId/CodingKeys/join":{"kind":"symbol","role":"symbol","url":"\/documentation\/discogsservice\/components\/schemas\/artistid\/codingkeys\/join","title":"Components.Schemas.ArtistId.CodingKeys.join","fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"join"}],"abstract":[],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId\/CodingKeys\/join","type":"topic"},"doc://DiscogsService/documentation/DiscogsService/Components/Schemas/ArtistId/CodingKeys":{"title":"Components.Schemas.ArtistId.CodingKeys","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId\/CodingKeys","navigatorTitle":[{"kind":"identifier","text":"CodingKeys"}],"abstract":[],"type":"topic","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"CodingKeys"}],"role":"symbol","url":"\/documentation\/discogsservice\/components\/schemas\/artistid\/codingkeys","kind":"symbol"},"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"}]}}}
{"kind":"symbol","primaryContentSections":[{"declarations":[{"tokens":[{"text":"case","kind":"keyword"},{"text":" ","kind":"text"},{"text":"join","kind":"identifier"}],"languages":["swift"],"platforms":["macOS"]}],"kind":"declarations"}],"metadata":{"symbolKind":"case","modules":[{"name":"DiscogsService"}],"roleHeading":"Case","role":"symbol","fragments":[{"text":"case","kind":"keyword"},{"text":" ","kind":"text"},{"text":"join","kind":"identifier"}],"externalID":"s:14DiscogsService10ComponentsO7SchemasO8ArtistIdV10CodingKeysO4joinyA2ImF","title":"Components.Schemas.ArtistId.CodingKeys.join"},"variants":[{"paths":["\/documentation\/discogsservice\/components\/schemas\/artistid\/codingkeys\/join"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId\/CodingKeys\/join"},"sections":[],"schemaVersion":{"patch":0,"major":0,"minor":3},"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId\/CodingKeys"]]},"references":{"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/ArtistId/CodingKeys/join":{"type":"topic","kind":"symbol","abstract":[],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId\/CodingKeys\/join","role":"symbol","url":"\/documentation\/discogsservice\/components\/schemas\/artistid\/codingkeys\/join","fragments":[{"text":"case","kind":"keyword"},{"text":" ","kind":"text"},{"text":"join","kind":"identifier"}],"title":"Components.Schemas.ArtistId.CodingKeys.join"},"doc://DiscogsService/documentation/DiscogsService/Components/Schemas/ArtistId/CodingKeys":{"navigatorTitle":[{"text":"CodingKeys","kind":"identifier"}],"role":"symbol","fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"CodingKeys","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId\/CodingKeys","title":"Components.Schemas.ArtistId.CodingKeys","abstract":[],"type":"topic","kind":"symbol","url":"\/documentation\/discogsservice\/components\/schemas\/artistid\/codingkeys"},"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"},"doc://DiscogsService/documentation/DiscogsService/Components/Schemas/ArtistId":{"navigatorTitle":[{"text":"ArtistId","kind":"identifier"}],"role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"ArtistId","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Components\/Schemas\/ArtistId","title":"Components.Schemas.ArtistId","abstract":[{"type":"text","text":"A type that references an artist."}],"type":"topic","kind":"symbol","url":"\/documentation\/discogsservice\/components\/schemas\/artistid"}}}