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
Using the openapi-generator-cli command over a swagger.json file generated by an asp.net project that uses OData doesn't work.
When using OData in an asp.net project, the operationId field in the swagger.json file is autogenerated and sometimes includes a '$' symbol. This causes an exception to be thrown in the console.
Manually removing the '$' symbol gets rid of the exception but I want to be able to keep it programmatic without having to manually modify the file.
Steps to reproduce
Run the following command openapi-generator-cli generate -g jmeter -i swagger.json swagger.json
[main] INFO o.o.codegen.DefaultGenerator - Generating with dryRun=false
[main] INFO o.o.c.ignore.CodegenIgnoreProcessor - No .openapi-generator-ignore file found.
[main] INFO o.o.codegen.DefaultGenerator - OpenAPI Generator: jmeter (client)
[main] INFO o.o.codegen.DefaultGenerator - Generator 'jmeter' is considered stable.
[main] INFO o.o.codegen.utils.URLPathUtils - 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
[main] INFO o.o.codegen.utils.URLPathUtils - 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
Exception in thread "main" java.lang.RuntimeException: Could not process operation:
Tag: class Tag {
name: Customers
description: null
externalDocs: null
}
Operation: Customers/$count
Resource: get /Customers/$count
Schemas: {}
Exception: Illegal group reference: group index is missing
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1269)
at org.openapitools.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:1160)
at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:609)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:994)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:519)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Caused by: java.lang.IllegalArgumentException: Illegal group reference: group index is missing
at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1030)
at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:998)
at java.base/java.util.regex.Matcher.replaceFirst(Matcher.java:1408)
at org.openapitools.codegen.utils.StringUtils.lambda$camelize$1(StringUtils.java:141)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2406)
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1908)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2404)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2387)
at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108)
at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62)
at org.openapitools.codegen.utils.StringUtils.camelize(StringUtils.java:135)
at org.openapitools.codegen.utils.StringUtils.camelize(StringUtils.java:115)
at org.openapitools.codegen.DefaultCodegen.addOperationToGroup(DefaultCodegen.java:5701)
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1239)
... 6 more
I expect the command to run properly and a jmeter file to be generated properly.
openapi-generator version
7.1.0 - installed via npm
The text was updated successfully, but these errors were encountered:
Description
Using the openapi-generator-cli command over a swagger.json file generated by an asp.net project that uses OData doesn't work.
When using OData in an asp.net project, the operationId field in the swagger.json file is autogenerated and sometimes includes a '$' symbol. This causes an exception to be thrown in the console.
Manually removing the '$' symbol gets rid of the exception but I want to be able to keep it programmatic without having to manually modify the file.
Steps to reproduce
Run the following command
openapi-generator-cli generate -g jmeter -i swagger.json
swagger.json
The following exception is thrown in the console:
I expect the command to run properly and a jmeter file to be generated properly.
openapi-generator version
7.1.0 - installed via npm
The text was updated successfully, but these errors were encountered: