fix(join): correctly prefix discriminator mapping refs#2642
fix(join): correctly prefix discriminator mapping refs#2642Daryna-del merged 4 commits intoRedocly:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 67ee74a 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 |
|
Overall looks good to me! |
|
@Daryna-del Thanks for reviewing! It looks like one of the smoke tests failed to start after merging in main. Anything I can do to help with that? Would love to get this one in 🙂 |
There could be some problems related to smoke test due to some external package updates. Could you please You can find those steps in CONTRIBUTNG.md file |
|
@maxwellpeterson Thanks for your contribution! |
|
@Daryna-del Thanks for releasing! We can close #1451 now too |
|
just wanna say we recognize and really appreciate how quickly you got this released. thank you! |
What/Why/How?
join --prefix-components-with-info-propcan leave invalid discriminator mapping refs when a schema name contains the same substring as the prefix (#1451).The join ref-rewrite logic used
name.includes(componentsPrefix), which incorrectly treated names likeCreateSomethingRequestas already prefixed when prefix isSomething.This change updates the discriminator mapping rewrite check to only skip refs that already start with the real prefix format (
<prefix>_), and adds a regression unit test to cover this case.Reference
Testing
npm run unit -- packages/cli/src/__tests__/commands/join.test.ts --coverage=falseincludes(...)logicstartsWith(prefix + '_')logicScreenshots (optional)
N/A
Check yourself
Security