-
Notifications
You must be signed in to change notification settings - Fork 200
Add DecimalTypeObject to test-integration (#143) #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DecimalTypeObject to test-integration (#143) #237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@minbumm Thanks for your PR!
I've left a few comments with regards to mainly to take care of the request payload. In addition to that, I was wondering where your test codes are. Would you please add it?
|
||
namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.TestApp | ||
{ | ||
public class Get_ApplicationJson_DecimalType_HttpTrigger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change both file name and class name to Post_ApplicationJson_DecimalType_HttpTrigger
?
{ | ||
[FunctionName(nameof(Get_ApplicationJson_DecimalType_HttpTrigger))] | ||
[OpenApiOperation(operationId: nameof(Get_ApplicationJson_DecimalType_HttpTrigger.Get_ApplicationJson_DecimalType), tags: new[] { "dataType" })] | ||
[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "application/json", bodyType: typeof(DecimalTypeObjectModel), Description = "The OK response")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need the OpenApiRequestBody(...)
attribute for the request payload.
...soft.Azure.WebJobs.Extensions.OpenApi.TestApp/Get_ApplicationJson_DecimalType_HttpTrigger.cs
Outdated
Show resolved
Hide resolved
|
Add Model : test-integration2/TestApps/Models/DecimalTypeObjectModel.cs |
…ntTypeSchema -> modified(propertyType ->propertyFormat)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote some reviews, please check your http trigger app with these reviews.
@@ -18,6 +18,7 @@ public class Post_ApplicationJson_DecimalType_HttpTrigger | |||
{ | |||
[FunctionName(nameof(Post_ApplicationJson_DecimalType_HttpTrigger))] | |||
[OpenApiOperation(operationId: nameof(Post_ApplicationJson_DecimalType_HttpTrigger.Post_ApplicationJson_DecimalType), tags: new[] { "demical" })] | |||
[OpenApiRequestBody(contentType: "application/octet-stream", bodyType: typeof(decimal), Required = true, Description = "The OK response")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contentType does not match with your test DataRow.
I think contentType should be "text/plain", not application/octet-stream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll give it a try
} | ||
|
||
[DataTestMethod] | ||
[DataRow("/post-applicationjson-decimal", "post", "text/plain", "number", "decimal")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a problem. Now data row has "decimal" value in propertyFormat, but the format of your app does not have any "decimal" format. I think it's better to change "decimal" to "double"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll give it a try
} | ||
|
||
[DataTestMethod] | ||
[DataRow("/post-applicationjson-decimal", "post", "200", "application/json", "decimalObjectModel")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem with "decimalObjectModel". you wrote your model type name "decimalTypeObjectModel". Please change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks i fixed it
} | ||
|
||
[DataTestMethod] | ||
[DataRow("decimaleObjectModel", "object")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem with "decimalObjectModel". you wrote your model type name "decimalTypeObjectModel". Please change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks i fixed it
} | ||
|
||
[DataTestMethod] | ||
[DataRow("decimalObjectModel", "decimalValue", "number", "decimal")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem with "decimalObjectModel". you wrote your model type name "decimalTypeObjectModel". Please change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks i fixed it
…m/azure-functions-openapi-extension into feature/test-integration2
…m/azure-functions-openapi-extension into feature/test-integration2
…m/azure-functions-openapi-extension into feature/test-integration2
this is integration tests for string visitor type.
This reverts commit af42aaf.
I made the mistake of doing the revert. |
Decimal Type was tested.

Is it right to do it this way?
It comes up as a double type with json.