-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Schema does not match health-indicator-result interface #2516
Comments
Makes sense! I set it to the |
This has now been released with 10.2.2 🎉 |
@BrunnerLivio, sadly but this does not solve my issue. I am using OpenAPI Generator to generate
This way typescript check fails for generated file: So, with 10.2.2 I am getting I have similar case in my own data model where generated code has
and this is translated to openAPI spec:
Looks like the missing part here is OpenAPI specification https://swagger.io/docs/specification/data-models/data-types/ regarding This is equivalent to and So, your change was right, however OpenAPI Generator (typescript-axios) behaves differently:
I would be very grateful, if you could add |
@pauliusg I see. Would it be possible you create a PR yourself so you can verify right away whether it will work or not with your setup? :) You can just fork & clone this repo, change the needed lines, run |
@BrunnerLivio, agreed. I will try. I am using |
@BrunnerLivio, good that I tried myself, required change #2523 was a bit different. After my changes:
Generated OpenAPI Generator file is without issues:
|
#2516 Fix additional props in openapi health schema
Released with v10.2.3 🎉 |
Is there an existing issue for this?
Current behavior
Schema returns
additionalProperties
oftype: 'string'
:https://github.com/nestjs/terminus/blob/master/lib/health-check/health-check.schema.ts#L26
When interface has
[optionalKeys: string]: any;
:https://github.com/nestjs/terminus/blob/master/lib/health-indicator/health-indicator-result.interface.ts#L22
Minimum reproduction code
Swagger:
![image](https://private-user-images.githubusercontent.com/1721818/301550439-866a82c8-a12e-4f66-b254-7020c14b7d30.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4ODg0NTgsIm5iZiI6MTczOTg4ODE1OCwicGF0aCI6Ii8xNzIxODE4LzMwMTU1MDQzOS04NjZhODJjOC1hMTJlLTRmNjYtYjI1NC03MDIwYzE0YjdkMzAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMTQxNTU4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDg5NTlmZTI1NDYzZTIzMWMxN2ZmMmM1MWIyMjA5YmI1MmEwZGJjNTNmZmM0NDVhYmJiNzdhMDY2OWZmOWYwOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.NeQ7Sp6BZF7QbaA_FPdWy6HQPVJIxn9nVPZI-9s1DOU)
Steps to reproduce
No response
Expected behavior
additionalProperties
should be oftype: 'any'
:Package version
9.2.2
NestJS version
9.4.2
Node.js version
18.19.0
In which operating systems have you tested?
Other
Would be nice to have a fix not only in the latest version, but also in 9.X.X!
The text was updated successfully, but these errors were encountered: