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
Revamp the spec package and document for stability
Revisit and make significant changes to the spec package toward public
stability, usability, and greater comprehension. Make the names of
things more consistent, the APIs more legible and user-friendly, and the
documentation thorough, with examples for each significant type.
Details:
* Add examples for all the various types.
* Make type names more consistent and appropriately descriptive:
* Always use `Func` as a prefix rather than sometimes `Function`
* Rename `FilterQuery` to `NodesQuery` to complement
`SingularQuery`
* Remove the `Func` prefix from the stringification of `FuncType`s
* Always use `Nodes` as a suffix in methods, constructors, and
value names (`FuncNodes`) than sometimes `NodeList` (but retain
the latter for types)
* `ValueType`, and `NodesType` stringification now returns
Go-formatted values rather than the strings "ValueType" and
"NodesType"
* Use variadic parameters in object constructors to decrease verbosity
and improve legibility.
* Ensure consistent stringification and implementation of
`fmt.Stringer`.
* Document the use cases for each type, and list interface
implementations for improved cross-referencing.
* Consistently use doc links when referring to other types, fix
invalid type names in doc comments, and copiously cross-reference
related types.
* Add constructors for most types that lacked them, and use them
consistently in the parser and registry packages.
* Add links to the relevant parts of [RFC 9535] for most types.
* Replace `FuncType.ConvertsTo()` method and its dependent data type,
`PathType`, with separate methods for each type that function
validators care about: `ConvertsToValue()`, `ConvertsToLogical()`,
and `ConvertsToNode()`.
* Make fields of most structs private where they weren't already. The
exception is `LocatedNode`, which is a simple wrapper around a value
and its location.
* Remove the "Package Stability" statement from the README.
Also: Add support for `json.Number` values to complement the existing
support for all Go numeric types. This should allow for transparent
handling of values marshaled with [json.Decoder.UseNumber] enabled.
[RFC 9535]: https://www.rfc-editor.org/rfc/rfc9535.html
[json.Decoder.UseNumber]: https://pkg.go.dev/encoding/json#Decoder.UseNumber
0 commit comments