-
Notifications
You must be signed in to change notification settings - Fork 62
Description
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.