ebowman / api-first-hand

API-First bootstrapping tool for building RESTful web services from a Swagger/OpenAPI spec
MIT License
142 stars 22 forks source link

JSON schema enums produce code that does not compile. #62

Closed alexec closed 5 years ago

alexec commented 7 years ago

I'll update when I have stack trace.

alexec commented 7 years ago

Workaround:

Cannot use the enum keyword. Remove, replace with pattern.

Good:

"foobar": {
    "type": "string, 
    "pattern: "(cash|accruals)"
}

Bad:

"foobar": {
    "type": "string, 
    "enum": [
        "cash", 
        "accruals"
    ]
}
LappleApple commented 7 years ago

Hi @alexec, if you'd like to make a PR to address the bug that would be great.

slavaschmidt commented 7 years ago

Should be resolved with https://github.com/zalando/api-first-hand/pull/73

s12v commented 7 years ago

@slavaschmidt, this seems to be fixed/merged/released?

slavaschmidt commented 7 years ago

@s12v, yeah, this should be fixed in 0.2.0, I had no time to manually verify that it works or add the example to the scripted test, therefore not closing the ticket yet.