Closed pararang closed 8 years ago
Hi @pararang,
This isn't possible at the moment, but it is something on our radar and in our roadmap. We're planning to make parameters use MSON, which would allow you to use one of which should allow you to achieve this.
+ Parameters
+ amount: 1200 (number) - Charge Amount
+ One Of
+ Properties
+ method: paypal (required, fixed)
+ email (required)
+ Properties
+ method: bank (required, fixed)
+ `bank_name` (required)
+ `bank_account` (required)
Please track this in https://github.com/apiaryio/api-blueprint-rfcs/pull/3 / https://github.com/apiaryio/api-blueprint/issues/286
+1
One Of
for Parameters
would be very useful. I need it right now.
What is the format for parameters if I have condition where some parameters can be changed based on another param's value. Eg: I have payment methods: paypal, bank transfer, etc.
+ amount (required, number,
1200) ... charge amount
+ method (required, string,
paypal) ... payment method
+ Values
paypal
bank transfer
etc
if method's value is "paypal", then my service need additional param:
+ email (required, string,
user@email.com) ... user's paypal account
if method's value is "bank transfer", then my service need additional params:
+ bank_name (required, string,
Panama National Bank) ... user's bank
+ bank_account (required, number,
3445315-XXX) ... user's bank account