Files
discogs-service/docs/data/documentation/discogsservice/apiprotocol/searchdatabase(query:headers:).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
13 KiB
JSON

{"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"searchDatabase"},{"kind":"text","text":"("},{"kind":"externalParam","text":"query"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","text":"Operations"},{"kind":"text","text":"."},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase","text":"searchDatabase"},{"kind":"text","text":"."},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase\/Input","text":"Input"},{"kind":"text","text":"."},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV5QueryV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase\/Input\/Query-swift.struct","text":"Query"},{"kind":"text","text":" = .init(), "},{"kind":"externalParam","text":"headers"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","text":"Operations"},{"kind":"text","text":"."},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase","text":"searchDatabase"},{"kind":"text","text":"."},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase\/Input","text":"Input"},{"kind":"text","text":"."},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV7HeadersV","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase\/Input\/Headers-swift.struct","text":"Headers"},{"kind":"text","text":" = .init()) "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> "},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","text":"Operations"},{"kind":"text","text":"."},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase","text":"searchDatabase"},{"kind":"text","text":"."},{"kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO6OutputO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase\/Output","text":"Output"}],"languages":["swift"]}]},{"content":[{"type":"heading","anchor":"discussion","level":2,"text":"Discussion"},{"type":"paragraph","inlineContent":[{"text":"Issue a search query to the Discogs database.","type":"text"}]},{"type":"paragraph","inlineContent":[{"type":"text","text":"This endpoint supports pagination and also, it requires authentication."}]},{"type":"aside","name":"Remark","content":[{"type":"paragraph","inlineContent":[{"text":"HTTP ","type":"text"},{"code":"GET \/database\/search","type":"codeVoice"},{"text":".","type":"text"}]}],"style":"note"},{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Generated from "},{"type":"codeVoice","code":"#\/paths\/\/database\/search\/get(searchDatabase)"},{"type":"text","text":"."}]}],"style":"note","name":"Remark","type":"aside"}],"kind":"content"}],"schemaVersion":{"minor":3,"major":0,"patch":0},"abstract":[{"type":"text","text":"Search any information from the database."}],"variants":[{"paths":["\/documentation\/discogsservice\/apiprotocol\/searchdatabase(query:headers:)"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/APIProtocol\/searchDatabase(query:headers:)","interfaceLanguage":"swift"},"metadata":{"role":"symbol","roleHeading":"Instance Method","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"searchDatabase"},{"kind":"text","text":"("},{"kind":"externalParam","text":"query"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"searchDatabase","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Query","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV5QueryV"},{"kind":"text","text":", "},{"kind":"externalParam","text":"headers"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"searchDatabase","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Headers","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV7HeadersV"},{"kind":"text","text":") "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"searchDatabase","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO6OutputO"}],"externalID":"s:14DiscogsService11APIProtocolPAAE14searchDatabase5query7headersAA10OperationsOADO6OutputOAI5InputV5QueryV_AM7HeadersVtYaKF","title":"searchDatabase(query:headers:)","extendedModule":"DiscogsService","modules":[{"name":"DiscogsService"}],"symbolKind":"method"},"sections":[],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/APIProtocol"]]},"kind":"symbol","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/Operations/searchDatabase/Input/Headers-swift.struct":{"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Headers","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase\/Input\/Headers-swift.struct","kind":"symbol","title":"Operations.searchDatabase.Input.Headers","role":"symbol","abstract":[],"url":"\/documentation\/discogsservice\/operations\/searchdatabase\/input\/headers-swift.struct","type":"topic","navigatorTitle":[{"text":"Headers","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Operations/searchDatabase":{"abstract":[{"type":"text","text":"Search any information from the database."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase","type":"topic","kind":"symbol","url":"\/documentation\/discogsservice\/operations\/searchdatabase","role":"symbol","navigatorTitle":[{"text":"searchDatabase","kind":"identifier"}],"fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"searchDatabase","kind":"identifier"}],"title":"Operations.searchDatabase"},"doc://DiscogsService/documentation/DiscogsService/Operations/searchDatabase/Input/Query-swift.struct":{"url":"\/documentation\/discogsservice\/operations\/searchdatabase\/input\/query-swift.struct","abstract":[],"title":"Operations.searchDatabase.Input.Query","navigatorTitle":[{"text":"Query","kind":"identifier"}],"kind":"symbol","type":"topic","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase\/Input\/Query-swift.struct","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Query","kind":"identifier"}],"role":"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/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/APIProtocol/searchDatabase(query:headers:)":{"type":"topic","role":"symbol","abstract":[{"type":"text","text":"Search any information from the database."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/APIProtocol\/searchDatabase(query:headers:)","title":"searchDatabase(query:headers:)","url":"\/documentation\/discogsservice\/apiprotocol\/searchdatabase(query:headers:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"searchDatabase"},{"kind":"text","text":"("},{"kind":"externalParam","text":"query"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"searchDatabase","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Query","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV5QueryV"},{"kind":"text","text":", "},{"kind":"externalParam","text":"headers"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"searchDatabase","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Headers","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO5InputV7HeadersV"},{"kind":"text","text":") "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"searchDatabase","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO14searchDatabaseO6OutputO"}],"kind":"symbol"},"doc://DiscogsService/documentation/DiscogsService/Operations/searchDatabase/Output":{"abstract":[],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase\/Output","type":"topic","kind":"symbol","url":"\/documentation\/discogsservice\/operations\/searchdatabase\/output","role":"symbol","navigatorTitle":[{"text":"Output","kind":"identifier"}],"fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Output","kind":"identifier"}],"title":"Operations.searchDatabase.Output"},"doc://DiscogsService/documentation/DiscogsService/Operations/searchDatabase/Input":{"url":"\/documentation\/discogsservice\/operations\/searchdatabase\/input","abstract":[],"title":"Operations.searchDatabase.Input","navigatorTitle":[{"text":"Input","kind":"identifier"}],"kind":"symbol","type":"topic","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/searchDatabase\/Input","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Input","kind":"identifier"}],"role":"symbol"}}}