You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
operationId: addOpportunityx-swagger-router-controller: opportunity.controllerdescription: Add a new opportunity. Returns a complete representation of the added opportunity.tags:
- opportunitysecurity:
- auth0:
- openidparameters:
- name: opportunitydescription: Properties to add to the opportunityin: bodyrequired: trueschema:
$ref: "./Opportunity.yaml"responses:
"200":
description: Successschema:
allOf:
- $ref: '../shared/newObject.yaml'
- $ref: './Opportunity.yaml'default:
description: Errorschema:
$ref: "../shared/errorResponse.yaml"
I get:
exportfunctionaddOpportunity(opportunity,info){returndispatch=>{dispatch({type: ADD_OPPORTUNITY_START,meta: { info }})returnopportunity.addOpportunity(opportunity).then(response=>dispatch({type: ADD_OPPORTUNITY,payload: response.data,error: response.error,meta: {res: response.raw,
info
}}))}}
As you can see, this isn't going to work: return opportunity.addOpportunity(opportunity). It's because the parameter passed to addOpportunity (opportunity, in this case) is also the same as the named import at the top of the file:
import*asopportunityfrom'../opportunity'
... and badness ensues. It's because my tags and params both have a thing called opportunity. I can work around this by changing the name of my param, but it's not unreasonable to name the parameter for a 'new opportunity' as opportunity.
Is this a quick/obvious fix for you? I'm happy to look into it, but I don't currently understand the guts of your templating system, so it might take me a while to get up to speed.
The text was updated successfully, but these errors were encountered:
Let me see how well I can explain this!
If I have a Swagger spec that contains this:
I get:
As you can see, this isn't going to work:
return opportunity.addOpportunity(opportunity)
. It's because the parameter passed toaddOpportunity
(opportunity
, in this case) is also the same as the named import at the top of the file:... and badness ensues. It's because my
tags
andparams
both have a thing calledopportunity
. I can work around this by changing the name of my param, but it's not unreasonable to name the parameter for a 'new opportunity' asopportunity
.Is this a quick/obvious fix for you? I'm happy to look into it, but I don't currently understand the guts of your templating system, so it might take me a while to get up to speed.
The text was updated successfully, but these errors were encountered: