OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Trying to generate Java code from the Vimeo OpenAPI spec.
That spec (api.yaml) uses backslashes in some of the strings (e.g. tag definitions).
Using the openapi gradle plugin 3.3.4 the generator 'spring' with any of it libraries (spring-boot, spring-mvc, spring-cloud) generates code which does not escape backslashes properly.
- add a new openapi configuration file config.json
- download the api.yaml from above Vimeo GitHub repo
- add a openapi statement to the build.gradle like this (the folders might differ)
- run ```./gradlew clean openApiGenerate```
- open one of the generated java files, e.g. LanguagesAPI
- check the tags annotation
tags={ "Videos\Languages", })
---> the backslash is not escaoped, leading to compile errors
##### Suggest a fix
- it looks like a bug with the generator templates, as it works proper for other generators (like feign for Java). Fixing the template should fix the issue.
Description
Trying to generate Java code from the Vimeo OpenAPI spec. That spec (api.yaml) uses backslashes in some of the strings (e.g. tag definitions). Using the openapi gradle plugin 3.3.4 the generator 'spring' with any of it libraries (spring-boot, spring-mvc, spring-cloud) generates code which does not escape backslashes properly.
openapi-generator version
3.3.4
OpenAPI declaration file content or url
Command line used for generation
As this is a gradle project the command line is just
but I'd assume the same code is generated when using the generator lib directly.
Steps to reproduce
apply plugin: 'org.openapi.generator'
openApiGenerate { validateSpec = true configFile = "$rootDir/vimeo/config.json".toString() inputSpec = "$rootDir/vimeo/openapi/api.yaml".toString() outputDir = "$buildDir/generated".toString() }
tags={ "Videos\Languages", })