Add anycrap.shop API#2490
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the initial OpenAPI 3.1.0 specification for the Anycrap.shop API, which includes endpoints for product management, category listing, and API key registration. The review feedback suggests several improvements to the specification: correcting an invalid URI example in the Product schema, adding descriptive text to the Error schema properties, and explicitly defining required fields in the response schemas for products and API key creation to ensure better compatibility with client generators.
| image: | ||
| type: string | ||
| format: uri | ||
| example: https://cdn.crapify.me/products/... |
There was a problem hiding this comment.
| error: | ||
| type: string | ||
| code: | ||
| type: string |
There was a problem hiding this comment.
The error and code properties in the Error schema lack descriptions. Providing clear descriptions for error fields helps developers understand and handle API errors more effectively.
error:
type: string
description: A human-readable error message.
code:
type: string
description: A machine-readable error code.| schema: | ||
| type: object | ||
| properties: | ||
| data: | ||
| type: array | ||
| items: | ||
| $ref: "#/components/schemas/Product" | ||
| meta: | ||
| $ref: "#/components/schemas/Meta" |
There was a problem hiding this comment.
The response schema for the 200 OK status should explicitly list data and meta as required properties to ensure client generators handle them correctly. This applies to other response schemas in this specification as well.
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/Product"
meta:
$ref: "#/components/schemas/Meta"
required:
- data
- meta| schema: | ||
| type: object | ||
| properties: | ||
| key: | ||
| type: string | ||
| example: ak_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4 | ||
| prefix: | ||
| type: string | ||
| example: ak_a1b2c3 | ||
| email: | ||
| type: string | ||
| example: dev@example.com |
There was a problem hiding this comment.
The response schema for the 201 Created status should specify that key, prefix, and email are required properties to ensure they are always expected by client implementations.
schema:
type: object
properties:
key:
type: string
example: ak_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
prefix:
type: string
example: ak_a1b2c3
email:
type: string
example: dev@example.com
required:
- key
- prefix
- email…quired fields to response schemas
Adds the Anycrap.shop API — a free REST API serving 35,000+ hand-curated absurdist AI-generated product concepts.