791ebf4f78
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>
1 line
16 KiB
JSON
1 line
16 KiB
JSON
{"abstract":[{"text":"Get information about a release","type":"text"}],"primaryContentSections":[{"declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getRelease","kind":"identifier"},{"text":"(","kind":"text"},{"text":"path","kind":"externalParam"},{"text":": ","kind":"text"},{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease","text":"getRelease","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input"},{"text":".","kind":"text"},{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input\/Path-swift.struct","text":"Path","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV4PathV","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"text":"query","kind":"externalParam"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","text":"Operations","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease","text":"getRelease","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input","text":"Input","kind":"typeIdentifier"},{"text":".","kind":"text"},{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input\/Query-swift.struct","text":"Query","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV5QueryV","kind":"typeIdentifier"},{"text":" = .init(), ","kind":"text"},{"text":"headers","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations"},{"text":".","kind":"text"},{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease","text":"getRelease","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input"},{"text":".","kind":"text"},{"text":"Headers","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV7HeadersV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input\/Headers-swift.struct"},{"text":" = .init()) ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations"},{"text":".","kind":"text"},{"text":"getRelease","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO6OutputO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Output"}]}],"kind":"declarations"},{"kind":"content","content":[{"anchor":"discussion","text":"Discussion","level":2,"type":"heading"},{"inlineContent":[{"type":"text","text":"Retrieves details for a specific release."}],"type":"paragraph"},{"name":"Remark","content":[{"type":"paragraph","inlineContent":[{"text":"HTTP ","type":"text"},{"type":"codeVoice","code":"GET \/releases\/{release_id}"},{"text":".","type":"text"}]}],"style":"note","type":"aside"},{"name":"Remark","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Generated from "},{"type":"codeVoice","code":"#\/paths\/\/releases\/{release_id}\/get(getRelease)"},{"type":"text","text":"."}]}],"style":"note","type":"aside"}]}],"kind":"symbol","metadata":{"symbolKind":"method","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getRelease","kind":"identifier"},{"text":"(","kind":"text"},{"text":"path","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"getRelease","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Path","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV4PathV","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"text":"query","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"getRelease","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Query","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV5QueryV","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"text":"headers","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"getRelease","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV7HeadersV","text":"Headers","kind":"typeIdentifier"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"getRelease","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO6OutputO"}],"externalID":"s:14DiscogsService11APIProtocolPAAE10getRelease4path5query7headersAA10OperationsOADO6OutputOAJ5InputV4PathV_AN5QueryVAN7HeadersVtYaKF","modules":[{"name":"DiscogsService"}],"extendedModule":"DiscogsService","roleHeading":"Instance Method","title":"getRelease(path:query:headers:)","role":"symbol"},"sections":[],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/APIProtocol"]]},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/APIProtocol\/getRelease(path:query:headers:)"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/apiprotocol\/getrelease(path:query:headers:)"]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"references":{"doc://DiscogsService/documentation/DiscogsService/APIProtocol":{"role":"symbol","title":"APIProtocol","kind":"symbol","type":"topic","abstract":[{"type":"text","text":"A type that performs HTTP operations defined by the OpenAPI document."}],"navigatorTitle":[{"text":"APIProtocol","kind":"identifier"}],"url":"\/documentation\/discogsservice\/apiprotocol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/APIProtocol","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"APIProtocol","kind":"identifier"}]},"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/Operations/getRelease/Output":{"role":"symbol","title":"Operations.getRelease.Output","kind":"symbol","type":"topic","abstract":[],"navigatorTitle":[{"text":"Output","kind":"identifier"}],"url":"\/documentation\/discogsservice\/operations\/getrelease\/output","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Output","fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Output","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Operations":{"type":"topic","title":"Operations","navigatorTitle":[{"text":"Operations","kind":"identifier"}],"abstract":[{"type":"text","text":"API operations, with input and output types, generated from "},{"type":"codeVoice","code":"#\/paths"},{"type":"text","text":" in the OpenAPI document."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","role":"symbol","url":"\/documentation\/discogsservice\/operations","fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Operations","kind":"identifier"}],"kind":"symbol"},"doc://DiscogsService/documentation/DiscogsService/Operations/getRelease/Input/Query-swift.struct":{"navigatorTitle":[{"kind":"identifier","text":"Query"}],"fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Query"}],"title":"Operations.getRelease.Input.Query","type":"topic","role":"symbol","abstract":[],"kind":"symbol","url":"\/documentation\/discogsservice\/operations\/getrelease\/input\/query-swift.struct","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input\/Query-swift.struct"},"doc://DiscogsService/documentation/DiscogsService/Operations/getRelease":{"type":"topic","title":"Operations.getRelease","navigatorTitle":[{"kind":"identifier","text":"getRelease"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease","abstract":[{"type":"text","text":"Get information about a release"}],"role":"symbol","url":"\/documentation\/discogsservice\/operations\/getrelease","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"getRelease"}],"kind":"symbol"},"doc://DiscogsService/documentation/DiscogsService/Operations/getRelease/Input/Path-swift.struct":{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input\/Path-swift.struct","kind":"symbol","type":"topic","role":"symbol","abstract":[],"fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Path"}],"title":"Operations.getRelease.Input.Path","navigatorTitle":[{"kind":"identifier","text":"Path"}],"url":"\/documentation\/discogsservice\/operations\/getrelease\/input\/path-swift.struct"},"doc://DiscogsService/documentation/DiscogsService/APIProtocol/getRelease(path:query:headers:)":{"url":"\/documentation\/discogsservice\/apiprotocol\/getrelease(path:query:headers:)","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getRelease","kind":"identifier"},{"text":"(","kind":"text"},{"text":"path","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"getRelease","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Path","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV4PathV","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"text":"query","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"getRelease","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Query","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV5QueryV","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"text":"headers","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"getRelease","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Headers","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO5InputV7HeadersV","kind":"typeIdentifier"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"getRelease","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO10getReleaseO6OutputO","kind":"typeIdentifier"}],"abstract":[{"text":"Get information about a release","type":"text"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/APIProtocol\/getRelease(path:query:headers:)","title":"getRelease(path:query:headers:)","type":"topic","kind":"symbol","role":"symbol"},"doc://DiscogsService/documentation/DiscogsService/Operations/getRelease/Input":{"url":"\/documentation\/discogsservice\/operations\/getrelease\/input","kind":"symbol","type":"topic","role":"symbol","abstract":[],"fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Input"}],"title":"Operations.getRelease.Input","navigatorTitle":[{"kind":"identifier","text":"Input"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input"},"doc://DiscogsService/documentation/DiscogsService/Operations/getRelease/Input/Headers-swift.struct":{"type":"topic","role":"symbol","navigatorTitle":[{"text":"Headers","kind":"identifier"}],"abstract":[],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getRelease\/Input\/Headers-swift.struct","title":"Operations.getRelease.Input.Headers","url":"\/documentation\/discogsservice\/operations\/getrelease\/input\/headers-swift.struct","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Headers","kind":"identifier"}],"kind":"symbol"}}} |