Skip to content

Print warning for optional path parameters #46

@bajtos

Description

@bajtos

Path parameters (remote "accepts" arguments mapped with { http: { source: 'path' } } are optional by default. At the moment, Swagger does not support optional path parameters (see OAI/OpenAPI-Specification#93).

This constraint is not clear to novice users. When they create remote methods with path parameters and don't pay attention to the required flag, they will end up with invalid swagger that's difficult to troubleshoot.

I'd like loopback-swagger to print a helpful warning explaining the users what's wrong and how to fix it when an optional path parameter is encountered.

Another option is to change loopback-swagger to always mark path parameters as required. However, I think it may close our future options for re-introducing optional path parameters again, which is something that was already requested by LoopBack users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions