Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gowon/discogsdotnet
https://github.com/gowon/discogsdotnet
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gowon/discogsdotnet
- Owner: gowon
- License: mit
- Created: 2023-05-21T01:57:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-14T08:30:52.000Z (about 2 months ago)
- Last Synced: 2024-11-14T09:30:54.032Z (about 2 months ago)
- Language: C#
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DiscogsDotNet
## Development
Discogs regretably does not provide an OpenAPI spec for their API, and lacks any real definition for response objects. An OAS spec would be ideal as tooling could generate clients in several languages, not just C#. A definitive community-driven OAS spec does not exist. Given the maturity of the API, once an OAS file has been created, it should be minimal to maintain.
### Sources
- contains Postman Collection v2.1/v2.0 Collections covering the Discogs API.
- contains [samples](https://github.com/buntine/discogs/tree/e2a600ee451eb00b4cef2b38adb7c645cda274d4/spec/samples) of the response objects for (all?) endpoints.### OpenAPI Spec Methodology
1. Download and extract source assets to `WORKDIR`:
```powershell
curl -fsSLO https://github.com/leopuleo/Discogs-Postman/archive/refs/heads/master.zip
curl -fsSLO https://github.com/buntine/discogs/archive/refs/heads/master.zip
```> [!NOTE]
> Make as many corrections to the source Postman script to clean up generated output2. Generate OpenAPI 3.x YAML spec from Postman Collection using [postman-to-openapi CLI tool](https://github.com/joolfe/postman-to-openapi):
```powershell
npx p2o .\Discogs.postman_collection-v2.1.json -f openapi.yaml -o .\p2o.options.json
```3. Generate OpenAPI Definitions from sample JSON responses using [mock-to-openapi CLI tool](https://github.com/OzzyCzech/mock-to-openapi)
```powershell
npx mock-to-openapi . .\yaml -v -w
```4. Combine all YAML into single spec file.
5. Generate C# API Client code from OpenAPI 3.x YAML using NSwag:
```powershell
nswag run .\src\DiscogsDotNet\nswag.json
```6. Add authorization and rate limiting support to generated client library
References:
-
### Collection Value Spreadsheet Methodology
1. Search User's custom fields for the ones that represent Media Condition and Sleeve Condition (id)
2. Get all (paged) releases in collection . (folder_id =1, per_page=100)
3. For each release (id, resource_url, artists:0:name, basic_information:title, year):
1. Get Price Suggestion
4. Export to Excel/CSV