Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kotlin] New reserved words #463

Closed
crazyk2 opened this issue Sep 12, 2019 · 1 comment
Closed

[Kotlin] New reserved words #463

crazyk2 opened this issue Sep 12, 2019 · 1 comment

Comments

@crazyk2
Copy link
Contributor

crazyk2 commented Sep 12, 2019

Contract

{
  "openapi": "3.0.0",
  "info": {
    "title": "Test Api",
    "version": "3.0.0"
  },
  "paths": {
    "/test/requestBodyRefTest": {
      "get": {
        "summary": "Test method",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Example"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Example": {
        "type": "object",
        "properties": {
          "state": {
            "enum": [
              "Actual",
              "Expect"
            ],
            "type": "string"
          }
        }
      }
    }
  }
}

actual and expect are reserved words
Generated result is

enum class State(val value: kotlin.String){
        actual("Actual"),
        expected("Expected")
    }

This code doesn't compile

@HugoMario
Copy link
Contributor

these PR:
#464
#488

were added to handled this. thanks again @crazyk2 for reporting this and work on it!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants