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
A type mismatch error is returned when the resolved value of a flag does not match the type requested. In the example below, the resolved value of `myBoolFlag` is a `boolean` but the request expects a `string` to be returned.
96
+
97
+
Command:
98
+
```sh
99
+
curl -X POST "localhost:8013/flags/myBoolFlag/resolve/string"
100
+
```
101
+
Result:
102
+
```sh
103
+
{"error_code":"TYPE_MISMATCH","reason":"ERROR"}
104
+
```
105
+
<br />
106
+
107
+
### Return flag not found error
108
+
109
+
The flag not found error is returned when flag key in the request doesn't match any configured flags.
110
+
111
+
Command:
112
+
```sh
113
+
curl -X POST "localhost:8013/flags/aMissingFlag/resolve/string"
curl -X POST "localhost:8013/flags/myIntFlag/resolve/int"
8
+
```
9
+
Result:
10
+
```sh
11
+
{"value":"1","reason":"STATIC","variant":"one"}
12
+
```
13
+
When interacting directly with the flagD http(s) api and requesting an `int` the response type will be a `string`. This behaviour is introduced by [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway), which uses [proto3 json mapping](https://developers.google.com/protocol-buffers/docs/proto3#json) to build the response object. If a number value is required, and none of the provided SDK's can be used, then it is recommended to use the `float64` endpoint instead:
14
+
<br />
15
+
Command:
16
+
```sh
17
+
curl -X POST "localhost:8013/flags/myIntFlag/resolve/float"
0 commit comments