Implement several feature requests and cleanup code
Possible Breaking Changes
Most users should not notice the difference, but there are a few things that might require changes to your code or build settings:
- Almost every struct and method/function that returns anything is now decorated with
[[nodiscard]]
, so you may get compiler warnings where you did not before. If you treat warnings as errors, this could also break your build. - The
[[nodiscard]]
annotations led me to notice that I was not checking the result of theResolverContext::NotifySubscribe
/ResolverContext::NotifyUnsubscribe
resolvers insubscribe
/unsubscribe
. I decided in 63ef2ce thatsubscribe
/unsubscribe
ought to propagate the errors by throwing an exception. If you have a default subscription object and it does not handle every field gracefully in theResolverContext::NotifySubscribe
/ResolverContext::NotifyUnsubscribe
case (for instance you are using the NYI generated stubs which throw exceptions), you may need to work around that. The changes in #240 allow a couple of ways to do that:- If you do not handle the
ResolverContext::NotifySubscribe
/ResolverContext::NotifyUnsubscribe
resolver calls, you can leave the default subscription object onOperations
empty and it will skip that call. You need to override the default (empty) subscription object in each call todeliver
if you were not already doing that, since the default subscription object is also used bydeliver
in the absence of an override. - You can override the subscription object used for
ResolverContext::NotifySubscribe
/ResolverContext::NotifyUnsubscribe
now insubscribe
/unsubscribe
, as an additional member inRequestSubscribeParams
/RequestUnsubscribeParams
.
- If you do not handle the
- PR #241 added support for generating multiple operation objects in a single request document from
clientgen
. Part of that involved moving theenum
andinput
type declarations to a shared namespace (already specified with the--namespace
parameter). They are re-exposed withusing
statements in the per-operation namespace, but since theinput
types used to be declared inline as part of theVariables
struct, you may need to remove theVariables::
scope from code which references them. You can now reference them from either the--namespace
shared namespace or the per-operation namespace which still contains theVariables
struct.
What's Changed
- Add a migration guide from v3.x to v4.x by @wravery in #236
- Add constexpr support to internal::sorted_map and internal::sorted_set by @wravery in #237
- Make the default subscription object optional and allow an override for subscribe/unsubscribe by @wravery in #240
- Output all operations from
clientgen
if the--operation
flag is not specified by @wravery in #241 - Code cleanup by @wravery in #242
- Update docs for next release by @wravery in #243
Full Changelog: v4.2.0...v4.3.0