Open michaelvannevel opened 6 years ago
For example say i have history/{id} as my route. I have a model
public class MyModel { public int Id{get;set;} public string Name{get;set;} }
I call it with http://someurl.com/history/14?name=bob Model binding would provide a MyModel with an Id of 14 and a Name of bob. My function has an argument express as: [HttpTrigger]MyModel model.
My guess is that the OpenApi spec is not including the object MyModel, and for that reason is throwing the previously mentioned error.
@eamonoreilly for OpenAPI
I have an API Management Service and an Azure Function. When trying to import the OpenApi spec via the API Management service 'Import Function' button I get an error. The error states something similar to 'values in your route template must be included as parameters to the function'. So if i create an httpfunction and use modelbinding by following [HttpTrigger]MyModel model it is bound with both values from the route and the querystring if its a get request. So the question is why do I get this error? Is it that the open api spec is being created incorrectly or?