question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add documantation for customization of path object

See original GitHub issue

Currently, I see no way of editing the path object inside the servcie. Only the definitions get parsed.

It would be great to add some information to the path object e.g. to set possible responses.

it could look something like this:

class MessagesService {

  constructor(options) {
    this.options = options || {};

    this.docs = {
      description: 'A service to send messages',
      definitions: {
        messages: { (...) }
      }
      path: {
        messages: {
          create: {   // Anything inside would override the default config for "/messages".post
            description: 'Custom POST description',
            responses: {
              '201': {
                description: 'New Message was created'
              }
            }
          }
        }
      }
    }
  }

  (...)
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
arddorcommented, Dec 7, 2016

This is something which I also discovered recently while looking closer at the sequelize example:

const doc = {
  description: 'Operations about Users.',
  definitions: {
    'UserPaginate': swagger.definition({
      attributes: {
        data: Sequelize.ARRAY('users')
      }
    }, {
      extends: ['paginate']
    })
  },
  definition: swagger.definition(model),
  securities: ['find'],
  find: {
    parameters: [{
      description: 'Get examples by name',
      in : 'query',
      required: false,
      name: 'email',
      type: 'string'
    }],
    responses: {
      '200': {
        description: 'successful operation',
        schema: {
          '$ref': '#/definitions/UserPaginate'
        }
      }
    }
  }
};

As you see you can define response with find, get, … I would say that there should be some more documentation to make that clear

0reactions
Mairucommented, May 24, 2019

This is all configurable by now. Documentation and examples were added with version 1.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Path Postprocessor Customization - FreeCAD Documentation
Path Postprocessor Customization · Contents · Introduction · What the postprocessor can do for you · Preparation for writing your own postprocessor.
Read more >
Customize pipeline configuration - GitLab Documentation
To customize the path: On the top bar, select Main menu > Projects and find your project. On the left sidebar, select Settings...
Read more >
sphinx.ext.autodoc – Include documentation from docstrings
This extension can import the modules you are documenting, and pull in documentation ... will by default only insert the docstring of the...
Read more >
Get started with Swashbuckle and ASP.NET Core
Learn how to add Swashbuckle to your ASP. ... Customize and extend. Swagger provides options for documenting the object model and ...
Read more >
Values that you specify when you create or update a distribution
If you want CloudFront to add custom headers whenever it sends a request to ... If the request for an object does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found