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

swagger-js model renderer does not parse/display model description #294

Closed
mohsen1 opened this issue Mar 18, 2015 · 4 comments
Closed

swagger-js model renderer does not parse/display model description #294

mohsen1 opened this issue Mar 18, 2015 · 4 comments
Assignees

Comments

@mohsen1
Copy link
Contributor

mohsen1 commented Mar 18, 2015

swagger-api/swagger-ui#406

@mohsen1 mohsen1 changed the title swagger-ui does not parse/display model description swagger-js model renderer does not parse/display model description Mar 18, 2015
@fehguy
Copy link
Contributor

fehguy commented Apr 10, 2015

I believe this used to work, must be a regression.

@whitlockjc
Copy link
Contributor

I just went back through the code, the last master merge from develop_2.0 before I got involved. The model description was never displayed prior so this is a new feature, not a regression.

@fehguy
Copy link
Contributor

fehguy commented May 7, 2015

I propose we move this to a future swagger-ui release, where the rendering will live in the UI code, not JS.

swagger-api/swagger-ui#1248

@fehguy fehguy closed this as completed May 7, 2015
@HolgerVogelsang
Copy link

I'ts not rocket science:

  1. Open swagger-ui.js
  2. Search for function processModel(schema, name)
  3. Change the first lines of this function to something like this (or whatever you want to display):
  function processModel(schema, name) {
    var type = schema.type || 'object';
    var isArray = schema.type === 'array';

    var html = schema.description !== undefined ? '<div style=\'margin-left: 0px; font-size: 14px;\'>' + strongOpen + '// ' + schema.description + strongClose + '</div>' : '';
    html += (strongOpen + name + ' ' + (isArray ? '[' : '{') + strongClose);

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

5 participants