Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Conversation

@kylef
Copy link
Member

@kylef kylef commented May 16, 2019

We should not place the exact same instance of a a referenced element in a final parse result tree multiple times, otherwise .freeze() won't work. Final ParseResult should contain unique instances in all cases and thus we must clone an element in these cases.

Fixes apiaryio/dredd#1360

@kylef kylef added the openapi3 label May 16, 2019
return testParseFixture(file);
});

it('handles multiple references to same parameter', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Using an integration test because this particular bug is with interplay of using parameters referenced from multiple different components with element freeze(). There's a lot of setup state for this and it's simpler to test referencing in this way.

@kylef kylef force-pushed the kylef/fix-multiple-ref-params branch 2 times, most recently from ad72329 to 4b16fd6 Compare May 16, 2019 22:33
@kylef
Copy link
Member Author

kylef commented May 16, 2019

I've also added similiar tests to ensure that all similiar referencing behaves correctly too.

@kylef kylef merged commit 673d073 into master May 17, 2019
@kylef kylef deleted the kylef/fix-multiple-ref-params branch May 17, 2019 09:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot assign to read only property 'parent' of object '#<MemberElement>'

2 participants