{"action":"created","issue":{"url":"https://api.github.com/repos/OpenAPITools/openapi-generator/issues/3761","repository_url":"https://api.github.com/repos/OpenAPITools/openapi-generator","labels_url":"https://api.github.com/repos/OpenAPITools/openapi-generator/issues/3761/labels{/name}","comments_url":"https://api.github.com/repos/OpenAPITools/openapi-generator/issues/3761/comments","events_url":"https://api.github.com/repos/OpenAPITools/openapi-generator/issues/3761/events","html_url":"https://github.com/OpenAPITools/openapi-generator/issues/3761","id":485285732,"node_id":"MDU6SXNzdWU0ODUyODU3MzI=","number":3761,"title":"[BUG] ClassCastException for any client","user":{"login":"karussell","id":129644,"node_id":"MDQ6VXNlcjEyOTY0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/129644?v=4","gravatar_id":"","url":"https://api.github.com/users/karussell","html_url":"https://github.com/karussell","followers_url":"https://api.github.com/users/karussell/followers","following_url":"https://api.github.com/users/karussell/following{/other_user}","gists_url":"https://api.github.com/users/karussell/gists{/gist_id}","starred_url":"https://api.github.com/users/karussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karussell/subscriptions","organizations_url":"https://api.github.com/users/karussell/orgs","repos_url":"https://api.github.com/users/karussell/repos","events_url":"https://api.github.com/users/karussell/events{/privacy}","received_events_url":"https://api.github.com/users/karussell/received_events","type":"User","site_admin":false},"labels":[{"id":931402924,"node_id":"MDU6TGFiZWw5MzE0MDI5MjQ=","url":"https://api.github.com/repos/OpenAPITools/openapi-generator/labels/Client:%20Java","name":"Client: Java","color":"fad8c7","default":false},{"id":931403399,"node_id":"MDU6TGFiZWw5MzE0MDMzOTk=","url":"https://api.github.com/repos/OpenAPITools/openapi-generator/labels/Issue:%20Bug","name":"Issue: Bug","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-08-26T15:04:51Z","updated_at":"2019-08-26T15:04:54Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"#### Bug Report Checklist\r\n\r\n- [x] Have you provided a full/minimal spec to reproduce the issue?\r\n- [x] Have you validated the input using an OpenAPI validator ([example](https://apidevtools.org/swagger-parser/online/)) -> this website does not work.\r\n- [x] What's the version of OpenAPI Generator used? 4.1.1\r\n- [x] Have you search for related issues/PRs?\r\n- [x] What's the actual output vs expected output? See below\r\n- [ ] [Optional] Bounty to sponsor the fix ([example](https://www.bountysource.com/issues/66123212-javascript-client-produces-a-wrong-object-for-a-string-enum-type-that-is-used-with-ref))\r\n\r\n##### Description\r\n\r\nI tried to generate a java client for the openapi spec:\r\n\r\nhttps://docs.graphhopper.com/openapi.yaml\r\n\r\nBut also other clients fail with the same exception. So maybe there is a problem with the spec but it should not fail with a ClassCastException IMO.\r\n\r\nBut I was able to create a Java client via pasting the spec into https://editor.swagger.io and so I assume the spec is roughly ok.\r\n\r\n##### OpenAPI declaration file content or url\r\n\r\nhttps://docs.graphhopper.com/openapi.yaml\r\n\r\n##### Command line used for generation\r\n\r\n```bash\r\njava -jar openapi-generator-cli-4.1.1.jar generate -i https://docs.graphhopper.com/openapi.yaml -g java -o java\r\n[main] INFO  o.o.codegen.DefaultGenerator - OpenAPI Generator: java (client)\r\n[main] INFO  o.o.codegen.DefaultGenerator - Generator 'java' is considered stable.\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE=\"/usr/local/bin/clang-format -i\"' (Linux/Mac)\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation getRoute\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation null\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation getIsochrone\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation getMatrix\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation postMatrix\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation calculateMatrix\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation getMatrixSolution\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation postGPX\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation getGeocode\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation solveVRP\r\n[main] INFO  o.o.c.languages.AbstractJavaCodegen - Processing operation getSolution\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: VehicleProfileId. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: VehicleProfileId. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: VehicleProfileId. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: VehicleProfileId. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: VehicleProfileId. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: VehicleProfileId. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: VehicleProfileId. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: VehicleProfileId. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - Unknown `format` int64 detected for type `number`. Defaulting to `number`\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: object. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: object. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: object. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: object. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: object. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: object. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: object. To fully utilize allOf, please use $ref instead of inline schema definition\r\n[main] WARN  o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: object. To fully utilize allOf, please use $ref instead of inline schema definition\r\nException in thread \"main\" java.lang.RuntimeException: Could not process model 'Request'.Please make sure that your schema is correct!\r\n\tat org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:470)\r\n\tat org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:920)\r\n\tat org.openapitools.codegen.cmd.Generate.run(Generate.java:400)\r\n\tat org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:60)\r\nCaused by: java.lang.ClassCastException: io.swagger.v3.oas.models.media.ObjectSchema cannot be cast to io.swagger.v3.oas.models.media.ArraySchema\r\n\tat org.openapitools.codegen.languages.AbstractJavaCodegen.toDefaultValue(AbstractJavaCodegen.java:721)\r\n\tat org.openapitools.codegen.DefaultCodegen.fromProperty(DefaultCodegen.java:2058)\r\n\tat org.openapitools.codegen.DefaultCodegen.fromProperty(DefaultCodegen.java:2271)\r\n\tat org.openapitools.codegen.DefaultCodegen.addVars(DefaultCodegen.java:3706)\r\n\tat org.openapitools.codegen.DefaultCodegen.addVars(DefaultCodegen.java:3654)\r\n\tat org.openapitools.codegen.DefaultCodegen.fromModel(DefaultCodegen.java:1918)\r\n\tat org.openapitools.codegen.languages.AbstractJavaCodegen.fromModel(AbstractJavaCodegen.java:942)\r\n\tat org.openapitools.codegen.DefaultGenerator.processModels(DefaultGenerator.java:1198)\r\n\tat org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:465)\r\n\t... 3 more\r\n```"},"comment":{"url":"https://api.github.com/repos/OpenAPITools/openapi-generator/issues/comments/524897473","html_url":"https://github.com/OpenAPITools/openapi-generator/issues/3761#issuecomment-524897473","issue_url":"https://api.github.com/repos/OpenAPITools/openapi-generator/issues/3761","id":524897473,"node_id":"MDEyOklzc3VlQ29tbWVudDUyNDg5NzQ3Mw==","user":{"login":"auto-labeler[bot]","id":45716194,"node_id":"MDM6Qm90NDU3MTYxOTQ=","avatar_url":"https://avatars1.githubusercontent.com/in/22040?v=4","gravatar_id":"","url":"https://api.github.com/users/auto-labeler%5Bbot%5D","html_url":"https://github.com/apps/auto-labeler","followers_url":"https://api.github.com/users/auto-labeler%5Bbot%5D/followers","following_url":"https://api.github.com/users/auto-labeler%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/auto-labeler%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/auto-labeler%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auto-labeler%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/auto-labeler%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/auto-labeler%5Bbot%5D/repos","events_url":"https://api.github.com/users/auto-labeler%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/auto-labeler%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2019-08-26T15:04:54Z","updated_at":"2019-08-26T15:04:54Z","author_association":"NONE","body":"👍 Thanks for opening this issue!\n🏷 I have applied any labels matching special text in your issue.\n\nThe team will review the labels and make any necessary changes.\n"}}
{"actor":{"display_login":"auto-labeler"}}