Skip to content
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

OpenAPI definition contains multiple, invalid path definitions for /users/{userid}/lifecycle/expire_password endpoint #610

Open
1 of 2 tasks
clevelm opened this issue Aug 16, 2021 · 4 comments

Comments

@clevelm
Copy link

clevelm commented Aug 16, 2021

ℹ️ If you have a question, please post it on the Okta Developer Forum instead. Issues in this repository are reserved for bug reports and feature requests only.

I'm submitting a

  • bug report
  • feature request

Background info

The OpenAPI definition (okta-sdk-java/src/swagger/api.yaml) contains two path definitions for the /users/{userid}/lifecycle/expire_password endpoint. Both definitions are invalid, because they both use the same path and attempt to differentiate themselves from each other using a query parameter. The paths are:

/api/v1/users/{userId}/lifecycle/expire_password?tempPassword=false
/api/v1/users/{userId}/lifecycle/expire_password?tempPassword=true

Query parameters are not part of a URI path (they are a separate part of the URI) and should not be included in a path in an Open API 2.0 API definition. Only valid path elements may appear in the path. (Per RFC-3986: "The path is terminated by the first question mark ("?") or number sign ("#") character, or by the end of the URI," so the "?tempPassword={value}" in the paths above should not be present. If the query string is ignored [as they should be, not being a part of the path], the paths are identical, thus creating an invalid definition file with duplicate paths.)

When this API definition is imported into systems (such as API gateways) which use OpenAPI definitions, they may fail to recognize the paths specified, or may fail to match the path at runtime. This is not an error on their part, as the paths included in the definition are malformed and invalid. The error is in the API definition provided here.

Describe your issue or request here (if necessary).

The API definition file needs to be corrected to contain only a single definition for the /expire_password endpoint. The content of the two existing path definitions needs to be merged (the two are slightly different).

Expected behavior

What should have happened?

What went wrong?

Please provide log or error messages if applicable.

Steps to reproduce

If the current behavior is a bug, please provide the steps to reproduce and a minimal demo if possible.

SDK Version

Identified in API version 2.2.4.
Verified (via GitHub) as still being present on master branch for version 2.4.0)

@arvindkrishnakumar-okta
Copy link
Contributor

arvindkrishnakumar-okta commented Aug 16, 2021

@clevelm Thanks for reporting this! You're right in pointing out that query params cannot be used in URI path in Open API spec 2.0. We are aware of this issue and are working on a comprehensive spec upgrade that would fix this issue. Stay tuned!

@arvindkrishnakumar-okta
Copy link
Contributor

Internal Ref: OKTA-418596

@arvindkrishnakumar-okta
Copy link
Contributor

Closing this in favor of https://github.com/okta/openapi/issues/265.

This will be fixed in the Open API spec release v3.

@clevelm
Copy link
Author

clevelm commented Jan 19, 2022 via email

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

No branches or pull requests

2 participants