[FEATURE] CAT json responses of type string with format #14818
Labels
>breaking
Identifies a breaking change.
Cluster Manager
discuss
Issues intended to help drive brainstorming and decision making
enhancement
Enhancement or improvement to existing feature or request
Is your feature request related to a problem?
cat requests return every field as string even though the actual value is a different one.
It would be nice to have the actual type of value and not only the string value. Uses would not need to convert each field by them self.
Example:
What solution would you like?
OpenAPI supports the format field.
https://swagger.io/docs/specification/data-models/data-types/#string
I suggest using the format field to define the actual type of the field. So for
search.throttled
the format would beboolean
,suggest.total
would beint64
andwarmer.total_time
would beduration
.What alternatives have you considered?
Another way would be to define pattern but this would make it more complicated and does not really serve the job.
Do you have any additional context?
Another question would be if fields that are not returned by default should be of type
["string", "null"]
as they are not present in every response?The text was updated successfully, but these errors were encountered: