Skip to content

Conversation

@starfy84
Copy link
Contributor

Ticket: DX-2582

This commit passes the defaultOpenAPIObject to the any case. This allows for us to not drop the jsdoc information on t.any types.

It is valid openapi to have descriptions and other metadata on any types: https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type

From the following slack thread: https://bitgo.slack.com/archives/C057BHBRG4B/p1765481932730759

Test

Tested in entity-validation (test2.json is before the changes)

$ > diff test.json test2.json
3123,3137c3123,3125
<                   "frontPhoto": {
<                     "description": "Front photo of the identity document",
<                     "example": "\"passport-front.jpg\"",
<                     "format": "binary"
<                   },
<                   "backPhoto": {
<                     "description": "Back photo of the identity document",
<                     "example": "\"drivers-license-back.png\"",
<                     "format": "binary"
<                   },
<                   "proofOfResidency": {
<                     "description": "Proof of residency",
<                     "example": "\"rental-lease.pdf\"",
<                     "format": "binary"
<                   }
---
>                   "frontPhoto": {},
>                   "backPhoto": {},
>                   "proofOfResidency": {}
3264,3278c3252,3254
<                   "frontPhoto": {
<                     "description": "Front photo of the identity document",
<                     "example": "\"passport-front.jpg\"",
<                     "format": "binary"
<                   },
<                   "backPhoto": {
<                     "description": "Back photo of the identity document",
<                     "example": "\"drivers-license-back.png\"",
<                     "format": "binary"
<                   },
<                   "proofOfResidency": {
<                     "description": "Proof of residency",
<                     "example": "\"rental-lease.pdf\"",
<                     "format": "binary"
<                   }
---
>                   "frontPhoto": {},
>                   "backPhoto": {},
>                   "proofOfResidency": {}

@starfy84 starfy84 self-assigned this Dec 16, 2025
@starfy84 starfy84 marked this pull request as ready for review December 16, 2025 15:36
@starfy84 starfy84 requested a review from a team as a code owner December 16, 2025 15:36
@starfy84 starfy84 enabled auto-merge December 16, 2025 15:37
@starfy84 starfy84 force-pushed the DX-2582-pass-jsdoc-descriptions branch from 133ca05 to cb82337 Compare December 16, 2025 15:40
Ticket: DX-2582

This commit passes the defaultOpenAPIObject to the any case. This allows for us to not drop the jsdoc information on t.any types.

It is valid openapi to have descriptions and other metadata on any types: https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type

From the following slack thread: https://bitgo.slack.com/archives/C057BHBRG4B/p1765481932730759

\# Test
Tested in `entity-validation`:
```
$ > diff test.json test2.json
3123,3137c3123,3125
<                   "frontPhoto": {
<                     "description": "Front photo of the identity document",
<                     "example": "\"passport-front.jpg\"",
<                     "format": "binary"
<                   },
<                   "backPhoto": {
<                     "description": "Back photo of the identity document",
<                     "example": "\"drivers-license-back.png\"",
<                     "format": "binary"
<                   },
<                   "proofOfResidency": {
<                     "description": "Proof of residency",
<                     "example": "\"rental-lease.pdf\"",
<                     "format": "binary"
<                   }
---
>                   "frontPhoto": {},
>                   "backPhoto": {},
>                   "proofOfResidency": {}
3264,3278c3252,3254
<                   "frontPhoto": {
<                     "description": "Front photo of the identity document",
<                     "example": "\"passport-front.jpg\"",
<                     "format": "binary"
<                   },
<                   "backPhoto": {
<                     "description": "Back photo of the identity document",
<                     "example": "\"drivers-license-back.png\"",
<                     "format": "binary"
<                   },
<                   "proofOfResidency": {
<                     "description": "Proof of residency",
<                     "example": "\"rental-lease.pdf\"",
<                     "format": "binary"
<                   }
---
>                   "frontPhoto": {},
>                   "backPhoto": {},
>                   "proofOfResidency": {}
```
@starfy84 starfy84 force-pushed the DX-2582-pass-jsdoc-descriptions branch from cb82337 to 942cc2f Compare December 16, 2025 15:41
Copy link
Contributor

@ericcrosson-bitgo ericcrosson-bitgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the ratio of test code to prod code (100:1 !)

Thanks @starfy84 🚀

@starfy84 starfy84 merged commit d05339a into master Dec 16, 2025
6 checks passed
@starfy84 starfy84 deleted the DX-2582-pass-jsdoc-descriptions branch December 16, 2025 15:55
@Taseen08
Copy link

Thanks for this change @starfy84 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants