fix(shared): support non-string discriminator property types#3385
fix(shared): support non-string discriminator property types#3385SipanP wants to merge 3 commits intohey-api:mainfrom
Conversation
|
|
|
@SipanP is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 53413ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3385 +/- ##
==========================================
- Coverage 39.59% 39.43% -0.17%
==========================================
Files 473 473
Lines 17080 17158 +78
Branches 5224 5267 +43
==========================================
+ Hits 6763 6766 +3
- Misses 8266 8319 +53
- Partials 2051 2073 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@SipanP are you able to resolve the typecheck fail? And since OpenAPI 2.0 parser was affected, can you add a spec + test the same way you did for 3.x? Looks good otherwise! |
OpenAPI discriminator mappings use string keys, but the actual discriminator property may be boolean, integer, or number. Previously, all discriminator values were hardcoded as type 'string'. This change detects the actual property type from the schema and converts mapping values accordingly.
73cecc5 to
53413ef
Compare
|
@mrlubos Fixed the typecheck. Ultimately, decided to remove the change in 2.0.x, as this version resolves discriminators by directly matching the discriminator value to a schema name and doesn't have the flexibility of mapping. |
OpenAPI discriminator mappings use string keys, but the actual discriminator property may be boolean, integer, or number. Previously, all discriminator values were hardcoded as type 'string'. This change detects the actual property type from the schema and converts mapping values accordingly.