You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not sure if this is a bug or mere inconvenience...
Description
Misleading exception message when having servers defined in OpenAPI schema but validating against a request object which does not match these servers.
Actual Behaviour
Given we have servers with url paths defined in schema and we're trying to validate a request GET /path against this schema an exception with message OpenAPI spec contains no such operation [/path,get] is raised. Even though GET /path is defined in schema.
Expected Behaviour
Exception message should tell that the request path could not be found for the defined servers.
e.g. OpenAPI spec contains no such operation [/path,get] for the defined servers
Exception Stacktrace
League\OpenAPIValidation\PSR15\Exception\InvalidServerRequestMessage raised in file /var/www/vendor/league/openapi-psr7-validator/src/PSR15/Exception/InvalidServerRequestMessage.php line 13:
Message: Server Request message failed validation
Stack Trace:
#0 /var/www/vendor/league/openapi-psr7-validator/src/PSR15/ValidationMiddleware.php(45): League\OpenAPIValidation\PSR15\Exception\InvalidServerRequestMessage::because(Object(League\OpenAPIValidation\PSR7\Exception\NoOperation))
[... snip ...]
#39 {main}
League\OpenAPIValidation\PSR7\Exception\NoOperation raised in file /var/www/vendor/league/openapi-psr7-validator/src/PSR7/Exception/NoOperation.php line 16:
Message: OpenAPI spec contains no such operation [/path,get]
Stack Trace:
#0 /var/www/vendor/league/openapi-psr7-validator/src/PSR7/ServerRequestValidator.php(67): League\OpenAPIValidation\PSR7\Exception\NoOperation::fromPathAndMethod('/path', 'get')
#1 /var/www/vendor/league/openapi-psr7-validator/src/PSR15/ValidationMiddleware.php(43): League\OpenAPIValidation\PSR7\ServerRequestValidator->validate(Object(Laminas\Diactoros\ServerRequest))
[... snip ...]
#40 {main}
not sure if this is a bug or mere inconvenience...
Description
Misleading exception message when having servers defined in OpenAPI schema but validating against a request object which does not match these servers.
Actual Behaviour
Given we have servers with url paths defined in schema and we're trying to validate a request
GET /path
against this schema an exception with messageOpenAPI spec contains no such operation [/path,get]
is raised. Even thoughGET /path
is defined in schema.Expected Behaviour
Exception message should tell that the request path could not be found for the defined servers.
e.g.
OpenAPI spec contains no such operation [/path,get] for the defined servers
Exception Stacktrace
Reproduction Steps
GET http://localhost/path
against this schemaThe text was updated successfully, but these errors were encountered: