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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
While trying to generate code from the yaml file using gradle (openApiGenerate), the task fails with the following error: Cannot invoke "java.util.Map.get(Object)" because the return value of "io.swagger.v3.oas.models.Operation.getExtensions()" is null
it happens for the files that contain webhooks definition (check OpenApi declaration file section).
openapi-generator version
'org.openapi.generator' version '7.10.0'
OpenAPI declaration file content or url
openapi: 3.1.0info:
title: Webhook Exampleversion: 1.0.0description: > Easy example of documentation with a single webhook, provided by OpenAPI Initiative.webhooks:
newPet:
post:
description: A new pet is born, let's come and discover it in Petstore.requestBody:
description: Information about a new pet in the systemcontent:
application/json:
schema:
$ref: "#/components/schemas/Pet"responses:
"200":
description: Return a 200 status to indicate that the data was received successfully
Generation Details
Just run any specification file that contains webhooks: definition with the gradle setup above.
kcichonczyk-getmoss
changed the title
[BUG][JAVA][SPRING] Not able to generate code with webhooks definition
[BUG][JAVA][SPRING] Not able to generate code from spec file with webhooks definition
Nov 25, 2024
Bug Report Checklist
Description
While trying to generate code from the yaml file using gradle (openApiGenerate), the task fails with the following error:
Cannot invoke "java.util.Map.get(Object)" because the return value of "io.swagger.v3.oas.models.Operation.getExtensions()" is null
it happens for the files that contain webhooks definition (check OpenApi declaration file section).
openapi-generator version
'org.openapi.generator' version '7.10.0'
OpenAPI declaration file content or url
Generation Details
Just run any specification file that contains webhooks: definition with the gradle setup above.
Steps to reproduce
Related issues/PRs
#13103
Suggest a fix
Implement null check here for extensions.
The text was updated successfully, but these errors were encountered: