Open ksato9700 opened 4 years ago
Can you try the latest master as I believe there was fixed already?
@wing328 Thank you for the information. I should have checked not only issues but also PRs. Sorry.
Now, I tried with the latest version and the Case 1 works as I expected! Unfortunately, Case2 still doesn't work, generating an empty message definition for the enum type. Are there any other suggestions, please?
For case 2, please use inline schema as a workaround for the time being.
For case 2, please use inline schema as a workaround for the time being.
Yes, I will. Thank you. At the same time, we occasionally define an enum type as a common schema, so that it can be referred from other schemas. Hopefully, it will be supported in the future.
Hi, I am having the same issue here and trying the suggestion that @wing328 for case 2 I have the same result: an empty enum. Here's my case
OpenAPI definition
BusinessesActionsRequest:
type: object
properties:
actions:
type: array
items:
$ref: '#/components/schemas/BusinessesActionEnum'
name:
type: string
classification:
type: string
sourceYears:
$ref: '#/components/schemas/SourceYears'
description: Describes the input criteria to match a person or a person at an address.
BusinessesActionEnum:
type: string
enum: [ACTIONS_LIST, COMPANY_COUNTY_COURT_JUDGEMENT, BUSINESS_MATCH, DIRECTORSHIPS]
default: ACTIONS_LIST
Protobuf files generated:
// business_actions_request.proto
syntax = "proto3";
package ***;
import public "models/businesses_action_enum.proto";
message BusinessesActionsRequest {
repeated BusinessesActionEnum actions = 88061701;
string name = 3373707;
string classification = 382350310;
// Years when the underlying dataset were issued. This could support compliance requirements.
repeated int32 sourceYears = 90636165;
}
// business_action_enum.proto
syntax = "proto3";
package ***;
message BusinessesActionEnum {
}
We have updated to latest openapi generator version but problem is still there. Any clue of what's happening? Thank you!
Bug Report Checklist
Description
Enum string fields are not converted as I expected. Is there a configuration setting to make it work? It would be nice if you can suggest if if there is, please.
Case 1
input
actual output
expected output
Case2
input
actual output
expected output
openapi-generator version
openapi-generator-cli:v4.3.
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
run the above command
Related issues/PRs
Suggest a fix