Giter Site home page Giter Site logo

Comments (2)

jmini avatar jmini commented on May 6, 2024

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.

viclovsky avatar viclovsky commented on May 6, 2024

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.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.