Skip to content

Swagger: Supply per-route description and summary for each action #25

@lennartS-7cs

Description

@lennartS-7cs

Currently the Swagger description and summary of each action is used for all routes, e.g. given an Action named Foo with two routes (one GET and on POST for the usual collection interface) both routes will have the exact same description and summary (Foo->getDescription() and Foo->getSummary()) shown in Swagger.

While there may be some Actions where this makes a lot of sense, at least in the case of generic collections it does not.

My proposal would be to return maps from both these functions:

virtual const char* getDescription() const;
virtual const char* getSummary() const;

would then become

virtual const std::map<qttp::HttpPath, const char*> getDescription() const;
virtual const std::map<qttp::HttpPath, const char*> getSummary() const;

Swagger::initialize() would have to be changed accordingly.

I think this would not be such a big change, but really help with usability of the generated Swagger documentation. I'd be willing to implement this, if you don't see any roadblocks and would accept a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions