Skip to content

Wrong JSON Schema keyword in getSignedURLs response schema #1023

@oniani1

Description

@oniani1

In src/http/routes/object/getSignedURLs.ts (line 38), the error property in the response schema uses error: as the JSON Schema keyword instead of type::

error: {
  error: ['string', 'null'],   // not a valid JSON Schema keyword
  examples: ['Either the object does not exist or you do not have access to it'],
},

The sibling signedURL property in the same schema object (line 46) correctly uses type: ['string', 'null'].

Because error: is not a recognized JSON Schema keyword, @fastify/swagger ignores it when generating the OpenAPI spec. The published API spec ends up with no type information for the error field, which affects anyone generating typed clients from it.

No runtime serialization impact since fast-json-stringify falls back to JSON.stringify for properties without a valid type, but the OpenAPI spec is incorrect.

Introduced in #106 (Feb 2022).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions