-
Notifications
You must be signed in to change notification settings - Fork 9k
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
fix: resolve unresolved schemas #9629
Changes from 5 commits
2dfea62
c0d6edb
e2626ce
cc17caf
80f68bb
55cbe8c
76fe7e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ export default class ObjectModel extends Component { | |
} | ||
</span>) | ||
|
||
const allOf = specSelectors.isOAS3() ? schema.get("allOf") : null | ||
const anyOf = specSelectors.isOAS3() ? schema.get("anyOf") : null | ||
const oneOf = specSelectors.isOAS3() ? schema.get("oneOf") : null | ||
const not = specSelectors.isOAS3() ? schema.get("not") : null | ||
|
@@ -194,6 +195,22 @@ export default class ObjectModel extends Component { | |
</td> | ||
</tr> | ||
} | ||
{ | ||
!allOf ? null | ||
: <tr> | ||
<td>{ "allOf ->" }</td> | ||
<td> | ||
{allOf.map((schema, k) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can fail if |
||
return <div key={k}><Model { ...otherProps } required={ false } | ||
getComponent={ getComponent } | ||
specPath={specPath.push("allOf", k)} | ||
getConfigs={ getConfigs } | ||
schema={ schema } | ||
depth={ depth + 1 } /></div> | ||
})} | ||
</td> | ||
</tr> | ||
} | ||
{ | ||
!anyOf ? null | ||
: <tr> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* @prettier | ||
*/ | ||
|
||
describe("OpenAPI 3.0 complex spec with allOf and nested references", () => { | ||
it("should render nested references", () => { | ||
cy.visit("/?url=/documents/features/oas3-complex-spec.json").then(() => { | ||
cy.get( | ||
"[id='model-com.sap.ctsm.backend.core.api.study.v1.StudyAPIv1.StudyTreatments-create']" | ||
) | ||
.find("button") | ||
.click() | ||
cy.get(".property-row") | ||
.contains("scenario") | ||
.siblings() | ||
.as("scenarioSiblings") | ||
cy.get("@scenarioSiblings").find("button").click() | ||
cy.get("@scenarioSiblings") | ||
.find("span") | ||
.contains("scenarioID") | ||
.should("not.exist") | ||
cy.get("@scenarioSiblings") | ||
.find("span") | ||
.contains("Scenarios (for create)") | ||
.should("exist") | ||
.click() | ||
cy.get("@scenarioSiblings") | ||
.find("span") | ||
.contains("scenarioID") | ||
.should("exist") | ||
cy.get("@scenarioSiblings") | ||
.find("span") | ||
.contains("#/components/schemas/unresolvedRef") | ||
.should("exist") | ||
}) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.