Skip to content

Schema derivation configuration#1304

Merged
adamw merged 2 commits intoscala3from
make-schema-derivation-configurable
Jun 10, 2021
Merged

Schema derivation configuration#1304
adamw merged 2 commits intoscala3from
make-schema-derivation-configurable

Conversation

@mbore
Copy link
Copy Markdown
Contributor

@mbore mbore commented Jun 9, 2021

No description provided.

@mbore mbore requested a review from adamw June 9, 2021 19:01

trait SchemaDerivation extends SchemaMagnoliaDerivation {
inline implicit def schemaForCaseClass[T](using Mirror.Of[T]): Derived[Schema[T]] = Derived(derived[T])
inline implicit def schemaForCaseClass[T](implicit m: Mirror.Of[T], cfg: Configuration): Derived[Schema[T]] = Derived(derived[T])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using doesn't work or it's just more convenient to use implicit? Maybe we could also try defining this using the given syntax?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just didn't want to mix up given/using with implicits.
Unfortunately we cannot go with the given syntax, because of compatibility with scala 2.x (it would require import sttp.tapir.generic.auto.given instead of import sttp.tapir.generic.auto._)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right. Ok, thanks :)

@adamw adamw merged commit 1784a5e into scala3 Jun 10, 2021
@mergify mergify Bot deleted the make-schema-derivation-configurable branch June 10, 2021 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants