Skip to content

allOf with multiple schemas adds additional square bracks in example - #378

Open
richard-walsh-sb wants to merge 6 commits into
swagger-api:masterfrom
richard-walsh-sb:bug/multipleAllOf
Open

allOf with multiple schemas adds additional square bracks in example#378
richard-walsh-sb wants to merge 6 commits into
swagger-api:masterfrom
richard-walsh-sb:bug/multipleAllOf

Conversation

@richard-walsh-sb

Copy link
Copy Markdown
Contributor

No description provided.

# Conflicts:
#	src/test/java/io/swagger/oas/test/examples/ExampleBuilderTest.java
@richard-walsh-sb richard-walsh-sb changed the title allOf with multiple schemas adds additional square bracks allOf with multiple schemas adds additional square bracks in example Sep 21, 2020

@gracekarina gracekarina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @richard-walsh-sb, I suggest to use the option resolveCombinators set to false.

Like this:

ParseOptions options = new ParseOptions();
options.setResolve(true);
options.setResolveFully(true);
options.setResolveCombinators(false);

I have tested locally and the example is generated without the extra bracks.

The ComposedSchema won’t be merged into one though, but the example will generate fine. Do you need the composedSchema merged into one new Schema?  

@gracekarina

gracekarina commented Feb 16, 2021

Copy link
Copy Markdown
Contributor

@richard-walsh-sb, I tried a different solution and this is the outcome: Will this work ? or pagination needs to be on a diferent node?

java.lang.AssertionError: expected [{
  "data" : [ {
    "topApiId" : "8ab9b11d-bf43-469e-a276-f601801d043c",
    "name" : "docman",
    "pathwaysVersion" : "0.1",
    "active" : false,
    "created" : "2018-07-21T17:32:28Z"
  }, {
    "topApiId" : "baa0dc91-9711-4b61-9c90-ce8ac0b109a9",
    "name" : "careweb",
    "pathwaysVersion" : "0.1",
    "active" : true,
    "created" : "2019-07-21T17:32:28Z"
  } ]
}, {
  "pagination" : {
    "offset" : 0,
    "limit" : 10,
    "totalResultCount" : 100
  }
}] but found [{
  "data" : [ {
    "topApiId" : "8ab9b11d-bf43-469e-a276-f601801d043c",
    "name" : "docman",
    "pathwaysVersion" : "0.1",
    "active" : false,
    "created" : "2018-07-21T17:32:28Z"
  }, {
    "topApiId" : "baa0dc91-9711-4b61-9c90-ce8ac0b109a9",
    "name" : "careweb",
    "pathwaysVersion" : "0.1",
    "active" : true,
    "created" : "2019-07-21T17:32:28Z"
  } ],
  "pagination" : {
    "offset" : 0,
    "limit" : 10,
    "totalResultCount" : 100
  }
}]

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.

2 participants