Files
discogs-service/docs/data/documentation/discogsservice/client/searchdatabase(_:).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
9.7 KiB
JSON

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