ePages-de / restdocs-api-spec

Adds API specification support to Spring REST Docs
MIT License
391 stars 103 forks source link

openapi3 task null exception #251

Closed jjunhwan-kim closed 8 months ago

jjunhwan-kim commented 1 year ago

Hi.

I use com.epages.restdocs-api-spec version 0.18.4.

recently I updated that library to version 0.19.0.

then when I execute command ./gradlew openapi3

there was an error like

> Task :openapi3 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':openapi3'.
> Cannot invoke "io.swagger.v3.oas.models.media.Schema.getTitle()" because the return value of "java.util.Map$Entry.getValue()" is null

What did I do wrong?

Thank you.

Jinwook94 commented 1 year ago

I'm facing the same issue.

I was using version 0.19.0, and it worked well for a few days without any problems. However, starting from today, I'm suddenly experiencing errors. There were no code changes, but an error began occurring during the build.

Error: Cannot invoke "io.swagger.v3.oas.models. media.Schema.getTitle)" because the return value of "java.util.Map$ Entry.get Value 0" is null

image


build.gradle

plugins {
    id 'org.springframework.boot' version '3.1.4'
    id 'io.spring.dependency-management' version '1.1.3'
    id 'com.epages.restdocs-api-spec' version '0.18.4'
    id 'java'
}

dependencies {
  ...
  testImplementation 'com.epages:restdocs-api-spec-mockmvc:0.18.4'
  ...
    }

openapi3 {
    servers = [
            {
                url = "https://staging.api.bootme.co.kr"
                description = "staging"
            },
            {
                url = "http://localhost:8080"
                description = "local"
            }
    ]
    title = 'BootMe API'
    description 'BootMe API'
    version = '0.0.1'
    format = 'json'
    contact = {
        name = 'Kim'
        email = '94@gmail.com'
    }
    separatePublicApi = false
    outputDirectory = "src/main/resources/static/docs/swagger/open-api-spec"
    outputFileNamePrefix = 'open-api-3.0.1'
}

Test code

Thanks,