jansson icon indicating copy to clipboard operation
jansson copied to clipboard

Provide better typed json_typeof

Open dwt opened this issue 1 year ago • 0 comments

Further down in the header the function json_error_code() is defined to return the enum json_error_code.

That function has a much better documentation value, as it also defines what values the returned value can have.

It also sets a naming precedent, of having a function of the same name as the enum, which makes a lot of sense to me.

In the future, when you bump the major version of the library anyway, you could change the define of json_typeof to

#define json_typeof json_type

and maybe start a deprecation cycle of the old name.

What do you think? Would that be a good patch?

dwt avatar Oct 31 '24 22:10 dwt