cancel
Showing results for 
Search instead for 
Did you mean: 

PHP Missing NameSpace When OneOf Reference Used

Frequent Visitor

PHP Missing NameSpace When OneOf Reference Used

Codegen 3.0.20.  Have an object defined as below. Swagger generates a OneOfPaymentResponseDataPaymentMethod and PaymentResponseData model files. 

 

In the PaymentResponseData class $swaggerTypes property the Namespace is not applied to payment_method. I have to manually add the Namespace here.

 

Not the author of this but trying to understand what is causing this. Thanks.

 

    protected static $swaggerTypes = [
'payment_type' => '\NameSpace\Model\PaymentType',
'payment_method' => 'OneOfPaymentResponseDataPaymentMethod',
'amount' => 'double',
'billing_first_name' => 'string',
'billing_last_name' => 'string',
'billing_phone' => 'string',
'billing_address' => '\NameSpace\Model\Address',
'notes' => 'string',
'error_message' => 'string' ];
PaymentResponseData:
type: object
required:
- paymentType
- paymentMethod
- amount
- billingFirstName
- billingLastName
- billingPhone
- billingAddress
- notes
properties:
paymentType:
$ref: "#/components/schemas/PaymentType"
paymentMethod:
oneOf:
- $ref: "#/components/schemas/CreditCardResponse"
- $ref: "#/components/schemas/CreditCardTokenResponse"
amount:
type: number
format: double
example: 550.12
billingFirstName:
type: string
example: John
billingLastName:
type: string
example: Smith
billingPhone:
type: string
example: 800-343-2891
billingAddress:
$ref: "#/components/schemas/Address"
notes:
type: string
errorMessage:
type: string
nullable: true

 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors