Skip to content

[java rest-assured] default is a reserved keyword #13

@jmini

Description

@jmini
Description

When the java generator (with restassured library) creates the project without any tags defined, a DefaultApi class is created.

In ApiClient the method to create this API is:

    public DefaultApi default() {
        return DefaultApi.default(config.baseReqSpec.get());
    }

This does not compile, because "default" is a reserved keyword in java.

The method (in this case only) should be named defaultApi().

openapi-generator version

3.0.0-SNAPSHOT

OpenAPI declaration file content or url
openapi: 3.0.1
info:
  title: ping test
  version: '1.0'
servers:
  - url: 'http://localhost:8000/'
paths:
  /ping:
    get:
      operationId: pingGet
      responses:
        '201':
          description: OK
Work around

Set a tag on the operations in order to change the default value to something else.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions