|
|
|
@ -1,5 +1,6 @@ |
|
|
|
import { eBindingSourceId, eMethodModifier } from '../enums'; |
|
|
|
import { camel } from '../utils'; |
|
|
|
import { isValidProp } from '../utils/prop'; |
|
|
|
import { camel } from '../utils/text'; |
|
|
|
import { ParameterInBody } from './api-definition'; |
|
|
|
import { Property } from './model'; |
|
|
|
import { Omissible } from './util'; |
|
|
|
@ -44,7 +45,11 @@ export class Body { |
|
|
|
const { bindingSourceId, descriptorName, jsonName, name, nameOnMethod } = param; |
|
|
|
const camelName = camel(name); |
|
|
|
const paramName = jsonName || camelName; |
|
|
|
const value = descriptorName ? `${descriptorName}.${paramName}` : nameOnMethod; |
|
|
|
const value = descriptorName |
|
|
|
? isValidProp(paramName) |
|
|
|
? `${descriptorName}.${paramName}` |
|
|
|
: `${descriptorName}['${paramName}']` |
|
|
|
: nameOnMethod; |
|
|
|
|
|
|
|
switch (bindingSourceId) { |
|
|
|
case eBindingSourceId.Model: |
|
|
|
|