I use angular 4.4.6 and I want to send a http request to swagger-enabled endpoint. I want to send a number there, but it always being sent as a string.
approve(id1: number){
.....
let params={id:id1}
return this.http.post(approveUrl, params)
.map(this.extractData)
.catch(this.handleError);
But I want to send number, not string, not anything else.
In my swagger:
parameters:
- name: body
schema:
required:
- id
properties:
id:
description: Priority order
type: number
format: int32
in: body
required: true
I always get 400 (Bad request) except one case: {id: 5}, where 5- any hardcoded number.
How to create a simple and bulletproof solution to send number?