-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Describe the bug
When we have service method accepting multiple request types, defined as, for example:
V2_myRequest:
type: object
required:
- type
properties:
type:
type: string
enum:
- t1
- t2
- t3
- t4
description: |
- `t1`: Type1
- `t2`: Type2
- `t3`: Type3
- `t4`: Type4
oneOf:
- $ref: "#/components/schemas/V2_myRequest_t1"
- $ref: "#/components/schemas/V2_myRequest_t2"
- $ref: "#/components/schemas/V2_myRequest_t3"
- $ref: "#/components/schemas/V2_myRequest_t4"Generated method only accepts only the first type:
public myMethodAsync(Type1 value) {
...
}Version 14.4.x was generating the method with object type, so all the request types could have been passed in. Something like:
public myMethodAsync(object value) {
...
}NSwag.ApiDescription.Client generates C# client
14.6.x
With which versions did you encounter this behavior.
14.6.2
Expected behavior
Or generate for overload for the method, with each type:
myMethodAsync(Type1 value) {
....
}
myMethodAsync(Type2 value) {
....
}
or generate method with object type like in previous versions (14.4.x).
Metadata
Metadata
Assignees
Labels
No labels