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

Class naming inconsistent in swagger comment to cause swagger generated sdk could not be built on case sensitive os. #1384

Closed
singlewind opened this issue Apr 24, 2019 · 3 comments · Fixed by #1394

Comments

@singlewind
Copy link

Describe the bug
There is inconsistent naming convention of class SwaggerJsonWebKeyQuery(SwaggerJSONWebKeyQuery) in the swagger document which cause issue for openapi-generator to generate sdk cannot be built on case sensitive os. (eg. Linux)

To Reproduce
Steps to reproduce the behavior:

  1. Run openapi-generator generate -g javascript -i https://raw.githubusercontent.com/ory/hydra/v1.0.0-rc.9%2BoryOS.10/docs/api.swagger.json -o ./ --additional-properties useES6=true
  2. Open src/index.js
  3. There is two entries:
import SwaggerJSONWebKeyQuery from './model/SwaggerJSONWebKeyQuery';
...
import SwaggerJsonWebKeyQuery from './model/SwaggerJsonWebKeyQuery';

Expected behavior
Can be build on any os.

Version:

  • Environment: [linux]
  • Version [v1.0.0.rc.9]

Additional context
It won't be problem on mac_os and windows if file system of os is case insensitive.
For simplicity, please just check

/**
* The SwaggerJSONWebKeyQuery model constructor.
* @property {module:model/SwaggerJSONWebKeyQuery}
*/
SwaggerJSONWebKeyQuery: SwaggerJSONWebKeyQuery,
/**
* The SwaggerJSONWebKeySet model constructor.
* @property {module:model/SwaggerJSONWebKeySet}
*/
SwaggerJSONWebKeySet: SwaggerJSONWebKeySet,
/**
* The SwaggerJsonWebKeyQuery model constructor.
* @property {module:model/SwaggerJsonWebKeyQuery}
*/
SwaggerJsonWebKeyQuery: SwaggerJsonWebKeyQuery,

@MDrollette
Copy link
Contributor

Running into this with the nodejs package (@oryd/hydra@1.0.0-rc.9) when building on debian.

14:41:28 🚨  /var/jenkins/app-build/node_modules/@oryd/hydra/sdk/js/swagger/src/index.js:22:1392: Cannot resolve dependency './model/SwaggerJSONWebKeyQuery' at '/var/jenkins/app-build/node_modules/@oryd/hydra/sdk/js/swagger/src/model/SwaggerJSONWebKeyQuery'
14:41:28   20 |   } else if (typeof module === 'object' && module.exports) {
14:41:28   21 |     // CommonJS-like environments that support module.exports, like Node.
14:41:28 > 22 |     module.exports = factory(require('./ApiClient'), require('./model/AcceptConsentRequest'), require('./model/AcceptLoginRequest'), require('./model/AuthenticationRequest'), require('./model/AuthenticationSession'), require('./model/Client'), require('./model/CompletedRequest'), require('./model/ConsentRequest'), require('./model/ConsentRequestSession'), require('./model/ConsentRequestSessionData'), require('./model/CreateRequest'), require('./model/EmptyResponse'), require('./model/FlushInactiveOAuth2TokensRequest'), require('./model/GenericError'), require('./model/HandledConsentRequest'), require('./model/HandledLoginRequest'), require('./model/HealthNotReadyStatus'), require('./model/HealthStatus'), require('./model/Introspection'), require('./model/JSONWebKey'), require('./model/JSONWebKeySet'), require('./model/JsonWebKeySetGeneratorRequest'), require('./model/LoginRequest'), require('./model/OAuth2Client'), require('./model/OAuth2TokenIntrospection'), require('./model/Oauth2TokenResponse'), require('./model/OauthTokenResponse'), require('./model/OpenIDConnectContext'), require('./model/PreviousConsentSession'), require('./model/RejectRequest'), require('./model/RequestDeniedError'), require('./model/RequestHandlerResponse'), require('./model/SwaggerFlushInactiveAccessTokens'), require('./model/SwaggerHealthStatus'), require('./model/SwaggerJSONWebKey'), require('./model/SwaggerJSONWebKeyQuery'), require('./model/SwaggerJSONWebKeySet'), require('./model/SwaggerJsonWebKeyQuery'), require('./model/SwaggerJwkCreateSet'), require('./model/SwaggerJwkSetQuery'), require('./model/SwaggerJwkUpdateSet'), require('./model/SwaggerJwkUpdateSetKey'), require('./model/SwaggerNotReadyStatus'), require('./model/SwaggerOAuthIntrospectionRequest'), require('./model/SwaggerOAuthTokenResponse'), require('./model/SwaggerRevokeOAuth2TokenParameters'), require('./model/SwaggerVersion'), require('./model/Swaggeroauth2TokenParameters'), require('./model/Swaggeroauth2TokenResponse'), require('./model/SwaggeruserinfoResponsePayload'), require('./model/UserinfoResponse'), require('./model/Version'), require('./model/WellKnown'), require('./api/AdminApi'), require('./api/HealthApi'), require('./api/PublicApi'), require('./api/VersionApi'));```

@aeneasr
Copy link
Member

aeneasr commented Apr 25, 2019

Grrr, swagger - damn you!. Any ideas how to fix this in swagger?

@aeneasr
Copy link
Member

aeneasr commented Apr 25, 2019

I guess as a first we can upgrade swagger-codegen now as we're no longer relying on the Go generator (which is completely broken in the new codegen version).

aeneasr added a commit that referenced this issue Apr 26, 2019
Previously, the SDK directory was included when generating the Swagger specification.
This caused issues due to duplicate models. This patch resolves that issue.

Closes #1384

Signed-off-by: aeneasr <aeneas@ory.sh>
aeneasr added a commit that referenced this issue Apr 27, 2019
Previously, the SDK directory was included when generating the Swagger specification.
This caused issues due to duplicate models. This patch resolves that issue.

Closes #1384

Signed-off-by: aeneasr <aeneas@ory.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants