Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentedAPIProperty doesn't work right #851

Open
Treeed opened this issue Feb 2, 2025 · 0 comments
Open

DocumentedAPIProperty doesn't work right #851

Treeed opened this issue Feb 2, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Treeed
Copy link
Contributor

Treeed commented Feb 2, 2025

Describe the bug
When a DocumentedAPIProperty is defined, it affects only the pure json schema and that schema then only contains the newly defined properties, not the automatically generated ones. These changes don't reflect what the API actually does.

To Reproduce
Go to partdb/api and observe the schema of GET /api/attachments/{id}

The schema for application/ld+json looks like this:

{
  "@context": "string",
  "@id": "string",
  "@type": "string",
  "name": "string",
  "element": {
    "name": "string",
    "id": 0
  },
  "show_in_table": true,
  "attachment_type": "https://example.com/",
  "addedDate": "2025-02-02T16:08:37.327Z",
  "lastModified": "2025-02-02T16:08:37.327Z",
  "id": 0,
  "picture": true,
  "3d_model": true,
  "external": true,
  "private": true,
  "builtIn": true,
  "url": "string"
}

The schema for application/json looks like this:

{
  "media_url": "/media/part/2/bc547-6508afa5a79c8.pdf",
  "thumbnail_url": "string"
}

Expected behavior
The specified property should be added to all schemata and leave the autogenerated parts of each schema untouched.

Server Side

  • Part-DB Version: 1.15.2
  • PHP Version: 8.3.15
  • Database Server SQLite
@Treeed Treeed added the bug Something isn't working label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant