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

Option to render all inherited parameters (when using 'allOf') #38

Open
msh321 opened this issue Sep 30, 2015 · 2 comments
Open

Option to render all inherited parameters (when using 'allOf') #38

msh321 opened this issue Sep 30, 2015 · 2 comments
Milestone

Comments

@msh321
Copy link

msh321 commented Sep 30, 2015

Consider the following Swagger Spec snippet:

"definitions" : {
    "AAA" : {
      "allOf" : [ {
        "$ref" : "#/definitions/BBB"
      }, {
        "type" : "object",
        "properties" : {
          "ttt" : {
            "type" : "string"
          }
        }
      } ]
    },
    "BBB" : {
      "allOf" : [ {
        "$ref" : "#/definitions/CCC"
      }, {
        "type" : "object",
        "properties" : {
          "vvv" : {
            "type" : "string"
          }
        }
      } ]
    },
    "CCC" : {
      "type" : "object",
      "properties" : {
        "uuu" : {
          "type" : "string"
        },
        "ppp" : {
          "type" : "string"
        }
      }
    }
  }

When you using "bootprint swagger" to generate HTML, then the object AAA only displays the property ttt (in addition, you can see that AAA inherits from BBB). So, in order to see all properties, you need to click on the BBB object and then on the CCC object (because BBB inherits from CCC).


It would be really cool if the generator had an option that would render all the inherited properties (directly in AAA), so that it becomes easier to see which properties are part of the definition of AAA.

I have created mock-up screenshots of how this could look:

Here the "INHERITED PROPERTIES" section is collapsed:
bp1

And here it is expanded:
bp2

@nknapp
Copy link
Member

nknapp commented Sep 30, 2015

It's an interesting feature. I can see the benefit. But before attempting to do this, I would like to do make sure that all of a swagger spec is really rendered. Some parts are still missing (not a lot) and this should be first priority.

In the long run, I would like to base bootprint on customize and customize-engine-handlebars which are both extracts of the bootprint-functionality. It would make it easier and cleaner to include the javascript libraries needed for interactive features (such as expanding nodes).

@nknapp nknapp added this to the 2.0.0 milestone Oct 18, 2015
@nknapp
Copy link
Member

nknapp commented Oct 28, 2015

@msh321 just wanted to let you know that I made the changes I was talking about to bootprint. Now, all I need is a customize-engine for a JavaScript minifier and possibly one for plain resources like images.
Then, interactive features like the one you wish for could be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants