Skip to content
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

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

richard-walsh-sb
Copy link
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
Copy link
Contributor

@gracekarina gracekarina left a comment

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
Copy link
Contributor

gracekarina commented Feb 16, 2021

@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