Conversation
Replace object info for products/coproducts, with an optional schema name. If a schema has a name, it will be rendered as a component in docs.
Coproducts now contain simply a list of child schemas, without the requirements for the schemas to be named
mbore
approved these changes
Jun 28, 2021
| */ | ||
| implicit def eitherRight[L, A, B, CF <: CodecFormat](implicit c1: Codec[L, A, CF], c2: Codec[L, B, CF]): Codec[L, Either[A, B], CF] = { | ||
| Codec | ||
| .id[L, CF](c1.format, Schema.binary) |
Contributor
There was a problem hiding this comment.
Why did you use the Schema.binary here?
Member
Author
There was a problem hiding this comment.
I needed to use some schema, but it's overriden later, so what's chosen here doesn't matter. I'll add a comment.
| List(${Varargs(instances)}: _*).asInstanceOf[List[T]], | ||
| None, | ||
| ${info} | ||
| ${name} |
Contributor
There was a problem hiding this comment.
hmmm I'm not sure if Validator should contain an instance of SName which is defined in Schema. What do youI think about defining SName a separate file?
Member
Author
There was a problem hiding this comment.
Hm well that's the name of the schema. I think it belongs to Schema.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1300
To do:
Option[SName]to each schema type; when this is present, the schema is considered to be a reusable component.SchemaType.SObjectInfowithSNameSchemaType.SObjectas an abstraction. Just haveSProductandSCoproductas regular implementations ofSchemaTypeSCoproductmore generic so that child schemas can be arbitrary (not just objects)Either(mirroring whateitherDecoderdoes)