New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger module path matching with path parameters sometimes doesn't work #2516

Closed
omusil24 opened this Issue Nov 29, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@omusil24
Contributor

omusil24 commented Nov 29, 2017

Unexpected exception: SCHEMA-VALIDATION-ERROR at /usr/share/qore-modules/0.8.13/Swagger.qm:1800
-----
	>> User exception: /usr/share/qore-modules/0.8.13/Swagger.qm:1800: SCHEMA-VALIDATION-ERROR: path component "4afb60b5f9c14a74bf165dfe07677cca" cannot be matched in "passenger/4afb60b5f9c14a74bf165dfe07677cca/photo"
	>> call stack:
	>>   PathComponent::match() called at /usr/share/qore-modules/0.8.13/Swagger.qm:1844 (user function)
	>>   PathsObject::match() called at /usr/share/qore-modules/0.8.13/Swagger.qm:1433 (user function)
	>>   SwaggerSchema::processRequestIntern() called at /usr/share/qore-modules/0.8.13/Swagger.qm:1138 (user function)
	>>   SwaggerSchema::processRequestImpl() called at /usr/share/qore-modules/0.8.13/RestSchemaValidator.qm:173 (user function)
	>>   AbstractRestSchemaValidator::processRequest() called at /usr/share/qore-modules/0.8.13/RestClient.qm:743 (user function)
	>>   RestClient::prepareMsg() called at /usr/share/qore-modules/0.8.13/RestClient.qm:816 (user function)
	>>   RestClient::doRequest() called at /usr/share/qore-modules/0.8.13/RestClient.qm:567 (user function)
	>>   RestClient::get() called at test/cip.qtest:597 (user function)

@omusil24 omusil24 added this to the 0.8.13.1 milestone Nov 29, 2017

@omusil24

This comment has been minimized.

Show comment
Hide comment
@omusil24

omusil24 Nov 29, 2017

Contributor

Actually happened because RestClient::get() was called with address not beginning with a slash. With slash it works as expected.

Contributor

omusil24 commented Nov 29, 2017

Actually happened because RestClient::get() was called with address not beginning with a slash. With slash it works as expected.

@davidnich

This comment has been minimized.

Show comment
Hide comment
@davidnich

davidnich Nov 29, 2017

Contributor

@omusil24 relative paths are currently not supported; we need to decide to either fix the docs or change the implementation - it's not totally clear to me which choice is better - your thoughts?

Contributor

davidnich commented Nov 29, 2017

@omusil24 relative paths are currently not supported; we need to decide to either fix the docs or change the implementation - it's not totally clear to me which choice is better - your thoughts?

@omusil24

This comment has been minimized.

Show comment
Hide comment
@omusil24

omusil24 Nov 29, 2017

Contributor

I think fixing the code to correctly handle paths not beginning with a slash is a better and more fool-proof solution.

Contributor

omusil24 commented Nov 29, 2017

I think fixing the code to correctly handle paths not beginning with a slash is a better and more fool-proof solution.

@omusil24 omusil24 self-assigned this Nov 30, 2017

davidnich added a commit that referenced this issue Dec 7, 2017

Merge pull request #2533 from qorelanguage/bugfix/2516_swagger_path_m…
…atching

Fixed #2516 path matching for paths not beginning with a slash

@davidnich davidnich closed this in b65a4f9 Dec 7, 2017

@omusil24 omusil24 added the fixed label Dec 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment