Files
discogs-service/docs/data/documentation/discogsservice/useragentmiddleware/clientmiddleware-implementations.json
T
javier 791ebf4f78 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>
2025-10-13 00:54:17 +00:00

1 line
4.2 KiB
JSON

{"topicSections":[{"generated":true,"title":"Instance Methods","anchor":"Instance-Methods","identifiers":["doc:\/\/DiscogsService\/documentation\/DiscogsService\/UserAgentMiddleware\/intercept(_:body:baseURL:operationID:next:)"]}],"schemaVersion":{"patch":0,"major":0,"minor":3},"sections":[],"identifier":{"url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/UserAgentMiddleware\/ClientMiddleware-Implementations","interfaceLanguage":"swift"},"metadata":{"title":"ClientMiddleware Implementations","role":"collectionGroup","modules":[{"name":"DiscogsService"}],"roleHeading":"API Collection"},"kind":"article","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/useragentmiddleware\/clientmiddleware-implementations"]}],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/UserAgentMiddleware"]]},"references":{"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/UserAgentMiddleware/intercept(_:body:baseURL:operationID:next:)":{"title":"intercept(_:body:baseURL:operationID:next:)","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/UserAgentMiddleware\/intercept(_:body:baseURL:operationID:next:)","kind":"symbol","abstract":[],"role":"symbol","type":"topic","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"intercept"},{"kind":"text","text":"("},{"kind":"typeIdentifier","preciseIdentifier":"s:9HTTPTypes11HTTPRequestV","text":"HTTPRequest"},{"kind":"text","text":", "},{"kind":"externalParam","text":"body"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:14OpenAPIRuntime8HTTPBodyC","text":"HTTPBody"},{"kind":"text","text":"?, "},{"kind":"externalParam","text":"baseURL"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:10Foundation3URLV","text":"URL"},{"kind":"text","text":", "},{"kind":"externalParam","text":"operationID"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"},{"kind":"text","text":", "},{"kind":"externalParam","text":"next"},{"kind":"text","text":": ("},{"kind":"typeIdentifier","preciseIdentifier":"s:9HTTPTypes11HTTPRequestV","text":"HTTPRequest"},{"kind":"text","text":", "},{"kind":"typeIdentifier","preciseIdentifier":"s:14OpenAPIRuntime8HTTPBodyC","text":"HTTPBody"},{"kind":"text","text":"?, "},{"kind":"typeIdentifier","preciseIdentifier":"s:10Foundation3URLV","text":"URL"},{"kind":"text","text":") "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> ("},{"kind":"typeIdentifier","preciseIdentifier":"s:9HTTPTypes12HTTPResponseV","text":"HTTPResponse"},{"kind":"text","text":", "},{"kind":"typeIdentifier","preciseIdentifier":"s:14OpenAPIRuntime8HTTPBodyC","text":"HTTPBody"},{"kind":"text","text":"?)) "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> ("},{"kind":"typeIdentifier","preciseIdentifier":"s:9HTTPTypes12HTTPResponseV","text":"HTTPResponse"},{"kind":"text","text":", "},{"kind":"typeIdentifier","preciseIdentifier":"s:14OpenAPIRuntime8HTTPBodyC","text":"HTTPBody"},{"kind":"text","text":"?)"}],"url":"\/documentation\/discogsservice\/useragentmiddleware\/intercept(_:body:baseurl:operationid:next:)"},"doc://DiscogsService/documentation/DiscogsService/UserAgentMiddleware":{"abstract":[{"type":"text","text":"A middleware that attaches the user agent header into the requests to the service."}],"type":"topic","kind":"symbol","role":"symbol","navigatorTitle":[{"kind":"identifier","text":"UserAgentMiddleware"}],"fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"UserAgentMiddleware"}],"title":"UserAgentMiddleware","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/UserAgentMiddleware","url":"\/documentation\/discogsservice\/useragentmiddleware"}}}