-
Notifications
You must be signed in to change notification settings - Fork 323
Mutator and HTTP Canonicalization updates #9141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
commit: |
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
Having used these tools for a reasonably complete REST emitter, the following fixes and improvements have been implemented:
Mutator framework
General
SimpleMutations andSimpleMutationEnginefor doing mutations of the graph where only one mutated type is needed per source type.Mutation Nodes
startXEdgemethod which returns aHalfEdgethat can be connected to the mutation node for that type. This is necessary because we can't know what node we're going to connect to in advance (since it depends on the eventualmutationKeywe'll calculate for it, see below). The only exception to this is when connecting to member types which refer back to the member container - connecting the container to a member will connect the member to the container.Mutations
mutationInfois called which returns a uniquemutationKeyfor that mutation (along with other information if needed). If themutationKeyhas been seen before, the previous one is returned. Otherwise, the appropriateMutationis constructed passing along the mutationInfo.mutationInfocan also return aMutation, in which case it is used directly. Useful for constructing a Mutation view "as if" the type graph looked a different way.MutationHalfEdgetypes for connected type which can be passed along to the engine'smutatemethod. When we figure out whatMutationto use based on themutationKeywe calculate, it is connected by callingsetTail.HTTP Canonicalization
General
subgraphMatchesPredicatetoHttpCanonicalizerandHttpCanonicalizationclasses. This is a cycle safe way to see if the subgraph rooted at a particular canonicalization all have a certain property.Codecs
detectmethod has been removed, codec instances haveencodewhich either returnsnullorEncodingInfoif it encodes the given type.Emitter framework