Change name format to in.name and update tests
This commit is contained in:
@@ -94,7 +94,7 @@ export default class Parameters extends Component {
|
|||||||
<ParameterRow fn={ fn }
|
<ParameterRow fn={ fn }
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
param={ parameter }
|
param={ parameter }
|
||||||
key={ `${parameter.get( "name" )}-${parameter.get("in")}` }
|
key={ `${parameter.get( "in" )}.${parameter.get("name")}` }
|
||||||
onChange={ this.onChange }
|
onChange={ this.onChange }
|
||||||
onChangeConsumes={this.onChangeConsumesWrapper}
|
onChangeConsumes={this.onChangeConsumesWrapper}
|
||||||
specSelectors={ specSelectors }
|
specSelectors={ specSelectors }
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ export function parameterValues(state, pathMethod, isXml) {
|
|||||||
let params = spec(state).getIn(["paths", ...pathMethod, "parameters"], fromJS([]))
|
let params = spec(state).getIn(["paths", ...pathMethod, "parameters"], fromJS([]))
|
||||||
return params.reduce( (hash, p) => {
|
return params.reduce( (hash, p) => {
|
||||||
let value = isXml && p.get("in") === "body" ? p.get("value_xml") : p.get("value")
|
let value = isXml && p.get("in") === "body" ? p.get("value_xml") : p.get("value")
|
||||||
return hash.set(`${p.get("name")}-${p.get("in")}`, value)
|
return hash.set(`${p.get("in")}.${p.get("name")}`, value)
|
||||||
}, fromJS({}))
|
}, fromJS({}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ describe("spec plugin - selectors", function(){
|
|||||||
|
|
||||||
// Then
|
// Then
|
||||||
expect(paramValues.toJS()).toEqual({
|
expect(paramValues.toJS()).toEqual({
|
||||||
"one-query": 1,
|
"query.one": 1,
|
||||||
"two-query": "duos"
|
"query.two": "duos"
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user