fastify / fastify/fastify-swagger

Extensions for the info object are not supported (at least in Typescript)

Open
#618 7 comments 0 reactions 0 assignees View on GitHub
semver-minor
Dominant language
JavaScript
Stars
1.1k
Forks
219
Avg merge
4h 24m
Merged PRs (30d)
2

Description

### Prerequisites

- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the bug has not already been reported

### Fastify version

4.0.0

### Plugin version

7.2.0

### Node.js version

16.15.0

### Operating system

macOS

### Operating system version (i.e. 20.04, 11.3, 10)

12.4 Monterey

### Description

We are using Fastify-Swagger to generate an Open API specification for our API and we want to use Open API extensions to extend the Info Object.
In particular we want to use the "x-logo" extension property.
WE are using Typescript and when the extension is added to the openapi.info object, the typescript compiler fails as the `InfoObject` interface definition does not allow extensions.

### Steps to Reproduce

Add a property `x-logo: {}` to the `openapi.info` object and compile the code.

### Expected Behavior

I would expect that both the type allows the usage of other property names than the ones in the specification, but also allow the usage of extensions.

Such extensions should be passed as-is when the specification is built.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.