Comments (3)
An other example:
openapi: 3.0.1
info:
title: ping test
version: '1.0'
servers:
- url: 'http://localhost:8000/'
paths:
/return/ping:
get:
tags:
- return
operationId: pingGet
responses:
'201':
description: OK
components:
schemas: {}
Produces also compile error:
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/ApiClient.java:[43,21] <identifier> expected
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/ApiClient.java:[43,28] illegal start of type
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/ApiClient.java:[43,29] <identifier> expected
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/ApiClient.java:[43,30] ';' expected
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/ApiClient.java:[44,9] illegal start of type
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/ApiClient.java:[44,25] ';' expected
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/ApiClient.java:[44,55] <identifier> expected
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/ApiClient.java:[44,57] ';' expected
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/ApiClient.java:[64,1] class, interface, or enum expected
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/api/ReturnApi.java:[44,28] <identifier> expected
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/api/ReturnApi.java:[44,35] illegal start of type
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/api/ReturnApi.java:[44,54] ';' expected
[ERROR] testIssue13-oapigen-rest-assured-java/src/main/java/org/openapitools/client/api/ReturnApi.java:[44,62] <identifier> expected
@viclovsky any input on how the method name should looks like when the name correspond to a java reserved keyword. Obviously those are not working:
public ReturnApi return()
public DefaultApi default()
Maybe we could append Api
to have something like this:
public ReturnApi returnApi()
public DefaultApi defaultApi()
from openapi-generator.
Hello, @jmini
Thanks a lot for detailed description of the issue.
To my mind the best sollution in your case will be to escape java reserved keyword as well in api as for methods.
from openapi-generator.
Hello, @jmini Thanks a lot for detailed description of the issue. To my mind the best sollution in your case will be to escape java reserved keyword as well in api as for methods.
this is still a critical issue since every single path with no tags assigned will end up in a DefaultApi class, generated by openapi-codegen. And a factory method named "default" (which as mentioned violates java syntax) is also generated by the openapi-codegen when used with restassured library as lib for API client classes generation. There is no way to escape java reserved keyword as was suggested, since it is internal to a code generation logics of the plugin itself.
Is it possible to either change default generated method convention, or provide an easy way to override it via plugin cofig option?
from openapi-generator.
Related Issues (20)
- Attempt to create a cumulative fix for missing Object.h, AnyType.h, Set.h for many generators: can you give me some knowledge you have to help me correcting them? HOT 2
- [BUG][RUST] Parameter with empty schema produces invalid rust code HOT 1
- [BUG][RUST] oneOf with multiple arrays produces invalid rust code HOT 4
- [BUG] [JAVA] Array of oneOf should be possible to be empty
- [BUG] [Java] oneOf inception provides wrong output in toJson HOT 4
- [BUG] [PYTHON] Model property: required AND default NOT combinable HOT 2
- [BUG][CSharp] DateOnly deserialized as DateTime and fails HOT 2
- [BUG] [JAVA] Cannot use oneOf as query parameter
- [BUG][JAVA] oneOf/anyOf validateJsonElement cannot find symbol
- [BUG][JAVA] oneOf/anyOf multiple constructors with same erasure
- [REQ] Add support for SecuritySchema mutualTLS
- [BUG][RUST-AXUM] rust-axum generator does not handle uuid::Uuid in headerParams
- [BUG][KOTLIN] kotlin-spring generator flag appendRequestToHandler generates broken code when used with flag delegatePattern
- [BUG][JAVA] {path} is URL Encoded
- [REQ] [ASPNETCORE] Add value types
- Documentation for typescript-fetch incorrectly indicates support for API and Model documentation
- [BUG] Generated Go (golang for the search algorithm) code does not compile.
- [kotlin-client] Upgrade versions of dependencies and Gradle
- [BUG][RUST_SERVER] Integration test fails because of clippy lint HOT 1
- [BUG] Mistype in InlineModelResolver leads to autogenerated class name instead of specified by title HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-generator.