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
14 KiB
JSON
1 line
14 KiB
JSON
{"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/client\/getreleaserating(path:headers:)"]}],"primaryContentSections":[{"declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getReleaseRating","kind":"identifier"},{"text":"(","kind":"text"},{"text":"path","kind":"externalParam"},{"text":": ","kind":"text"},{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseRating","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating\/Input","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV"},{"text":".","kind":"text"},{"text":"Path","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating\/Input\/Path-swift.struct","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV4PathV"},{"text":", ","kind":"text"},{"text":"headers","kind":"externalParam"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","text":"Operations","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating","text":"getReleaseRating","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating\/Input","text":"Input","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV7HeadersV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating\/Input\/Headers-swift.struct","text":"Headers","kind":"typeIdentifier"},{"text":" = .init()) ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","text":"Operations","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"getReleaseRating","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating\/Output","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO6OutputO"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"},{"content":[{"type":"heading","text":"Discussion","anchor":"discussion","level":2},{"type":"paragraph","inlineContent":[{"text":"Retrieves the average rating and the total number of user ratings for a given release.","type":"text"}]},{"name":"Remark","style":"note","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"HTTP "},{"type":"codeVoice","code":"GET \/releases\/{release_id}\/rating"},{"type":"text","text":"."}]}],"type":"aside"},{"name":"Remark","style":"note","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Generated from "},{"type":"codeVoice","code":"#\/paths\/\/releases\/{release_id}\/rating\/get(getReleaseRating)"},{"type":"text","text":"."}]}],"type":"aside"}],"kind":"content"}],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client"]]},"kind":"symbol","schemaVersion":{"patch":0,"major":0,"minor":3},"sections":[],"abstract":[{"type":"text","text":"Get information about a rating of release."}],"metadata":{"modules":[{"name":"DiscogsService"}],"role":"symbol","title":"getReleaseRating(path:headers:)","extendedModule":"DiscogsService","externalID":"s:14DiscogsService11APIProtocolPAAE16getReleaseRating4path7headersAA10OperationsOADO6OutputOAI5InputV4PathV_AM7HeadersVtYaKF::SYNTHESIZED::s:14DiscogsService6ClientV","symbolKind":"method","roleHeading":"Instance Method","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"getReleaseRating"},{"kind":"text","text":"("},{"kind":"externalParam","text":"path"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"getReleaseRating","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Path","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV4PathV"},{"kind":"text","text":", "},{"kind":"externalParam","text":"headers"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"getReleaseRating","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Headers","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV7HeadersV"},{"kind":"text","text":") "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"getReleaseRating","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO"},{"text":".","kind":"text"},{"kind":"typeIdentifier","text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO6OutputO"}]},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getReleaseRating(path:headers:)"},"references":{"doc://DiscogsService/documentation/DiscogsService/Client/getReleaseRating(path:headers:)":{"title":"getReleaseRating(path:headers:)","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getReleaseRating(path:headers:)","kind":"symbol","abstract":[{"text":"Get information about a rating of release.","type":"text"}],"role":"symbol","type":"topic","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getReleaseRating","kind":"identifier"},{"text":"(","kind":"text"},{"text":"path","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseRating","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV"},{"text":".","kind":"text"},{"text":"Path","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV4PathV"},{"text":", ","kind":"text"},{"text":"headers","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseRating","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV"},{"text":".","kind":"text"},{"text":"Headers","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO5InputV7HeadersV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseRating","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO16getReleaseRatingO6OutputO"}],"url":"\/documentation\/discogsservice\/client\/getreleaserating(path:headers:)"},"doc://DiscogsService/documentation/DiscogsService/Client":{"url":"\/documentation\/discogsservice\/client","type":"topic","title":"Client","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Client","kind":"identifier"}],"navigatorTitle":[{"text":"Client","kind":"identifier"}],"abstract":[{"text":"The Discogs API v2.0 is a RESTful interface to Discogs data. You can access JSON-formatted information about Database objects such as ","type":"text"},{"inlineContent":[{"type":"text","text":"Artists"}],"type":"emphasis"},{"text":", ","type":"text"},{"inlineContent":[{"type":"text","text":"Releases"}],"type":"emphasis"},{"text":", and ","type":"text"},{"inlineContent":[{"type":"text","text":"Labels"}],"type":"emphasis"},{"text":". Your application can also manage ","type":"text"},{"inlineContent":[{"type":"text","text":"User Collections"}],"type":"emphasis"},{"text":" and ","type":"text"},{"inlineContent":[{"type":"text","text":"Wantlists"}],"type":"emphasis"},{"text":", create ","type":"text"},{"inlineContent":[{"type":"text","text":"Marketplace"}],"type":"emphasis"},{"text":" listings, and more.","type":"text"}],"role":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client"},"doc://DiscogsService/documentation/DiscogsService/Operations/getReleaseRating":{"type":"topic","kind":"symbol","navigatorTitle":[{"text":"getReleaseRating","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating","abstract":[{"type":"text","text":"Get information about a rating of release."}],"role":"symbol","url":"\/documentation\/discogsservice\/operations\/getreleaserating","fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getReleaseRating","kind":"identifier"}],"title":"Operations.getReleaseRating"},"doc://DiscogsService/documentation/DiscogsService/Operations/getReleaseRating/Input/Headers-swift.struct":{"navigatorTitle":[{"kind":"identifier","text":"Headers"}],"role":"symbol","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Headers"}],"title":"Operations.getReleaseRating.Input.Headers","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating\/Input\/Headers-swift.struct","abstract":[],"type":"topic","kind":"symbol","url":"\/documentation\/discogsservice\/operations\/getreleaserating\/input\/headers-swift.struct"},"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":{"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/getReleaseRating/Output":{"abstract":[],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating\/Output","type":"topic","url":"\/documentation\/discogsservice\/operations\/getreleaserating\/output","kind":"symbol","role":"symbol","navigatorTitle":[{"text":"Output","kind":"identifier"}],"fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Output","kind":"identifier"}],"title":"Operations.getReleaseRating.Output"},"doc://DiscogsService/documentation/DiscogsService/Operations/getReleaseRating/Input":{"type":"topic","kind":"symbol","navigatorTitle":[{"text":"Input","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating\/Input","abstract":[],"role":"symbol","url":"\/documentation\/discogsservice\/operations\/getreleaserating\/input","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Input","kind":"identifier"}],"title":"Operations.getReleaseRating.Input"},"doc://DiscogsService/documentation/DiscogsService/Operations/getReleaseRating/Input/Path-swift.struct":{"type":"topic","kind":"symbol","navigatorTitle":[{"text":"Path","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseRating\/Input\/Path-swift.struct","abstract":[],"role":"symbol","url":"\/documentation\/discogsservice\/operations\/getreleaserating\/input\/path-swift.struct","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Path","kind":"identifier"}],"title":"Operations.getReleaseRating.Input.Path"}}} |