OpenAPITools / OpenAPITools/openapi-generator

[BUG] [JAVA] NoSuchMethod org.yaml.snakeyaml.events.MappingStartEvent

Open
#15,319 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Build fails with Gradle 5.6.1

Expected: Build success
Actual: Failure:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:service:openApiGenerate'.
> org.yaml.snakeyaml.events.MappingStartEvent.<init>(Ljava/lang/String;Ljava/lang/String;ZLorg/yaml/snakeyaml/error/Mark;Lorg/yaml/snakeyaml/error/Mark;Lorg/yaml/snakeyaml/DumperOptions$FlowStyle;)V
openapi-generator version

OpenApiGen 6.5.0

OpenAPI declaration file content or url
openapi: 3.0.0

info:
  title: example
  version: 1.0.0
  description: example
  contact:
    email: example@example.com

servers:
- url: http://example.com/v0

tags:
- name: example
  description: example
  externalDocs:
    description: example
    url: example

paths:
  '/example':
    get:
      tags: [example]
      summary: example
      operationId: example
      responses:
        '200':
          description: example
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Example'
        '404':
          description: example

components:
  schemas:
    Example:
      type: object
      description: example.
      required: [example]
      properties:
        example:
          type: integer
          description: example
          format: int32
          minimum: 0
Generation Details

openApiGenerate {
generatorName = "java"
generateApiDocumentation = false
generateApiTests = false
generateModelTests = false
generateModelDocumentation = false
inputSpec = "${project.projectDir}/src/main/webapp/WEB-INF/test.yaml".toString()
outputDir = "${project.projectDir}".toString()
packageName = "ch.test.ws"
apiPackage = "ch.test.ws.api"
invokerPackage = "ch.test.ws.client"
modelPackage = "ch.test.ws.model"
library = "resttemplate"
skipValidateSpec = true
configOptions = [
dateLibrary: "java8"
]
}

Steps to reproduce
Related issues/PRs

(https://github.com/OpenAPITools/openapi-generator/issues/2099)

Suggest a fix

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure from the Gradle openApiGenerate configuration shown in the issue, using OpenApiGen 6.5.0 and Gradle 5.6.1. Inspect the resolved SnakeYAML version and the MappingStartEvent constructor mismatch. Done means the provided Java generation setup completes successfully with the example OpenAPI declaration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.