Skip to content

Commit cc7b1b9

Browse files
author
Matthieu Leclercq
committed
Make some methods private[generic].
They can't be made `private` because of scala/scala3#11706 But private[generic] seems to work and is better than public
1 parent eb80bde commit cc7b1b9

File tree

1 file changed

+5
-5
lines changed
  • json-schema/json-schema-generic/src/main/scala-3/endpoints4s/generic

1 file changed

+5
-5
lines changed

json-schema/json-schema-generic/src/main/scala-3/endpoints4s/generic/JsonSchemas.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ trait JsonSchemas extends algebra.JsonSchemas:
119119
* @param defaultValues List of the possible default values of the record fields (e.g.,
120120
* `(Some(42), None)`)
121121
*/
122-
inline def summonRecord[
122+
private[generic] inline def summonRecord[
123123
Types <: Tuple,
124124
Labels <: Tuple,
125125
Docs <: Tuple,
@@ -173,7 +173,7 @@ trait JsonSchemas extends algebra.JsonSchemas:
173173
* has a [[title @title]] annotation, it is used as a title, otherwise
174174
* the schema has no title
175175
*/
176-
inline def summonTitle[A]: Option[String] =
176+
private[generic] inline def summonTitle[A]: Option[String] =
177177
summonFrom {
178178
case annotation: Annotation[`title`, A] => Some(annotation().value)
179179
case _ => None
@@ -185,7 +185,7 @@ trait JsonSchemas extends algebra.JsonSchemas:
185185
* name, otherwise it has the result of calling [[classTagToSchemaName]]
186186
* with a `ClassTag[A]`.
187187
*/
188-
inline def summonName[A]: Option[String] =
188+
private[generic] inline def summonName[A]: Option[String] =
189189
summonFrom {
190190
case annotation: Annotation[`name`, A] => Some(annotation().value)
191191
case annotation: Annotation[`unnamed`, A] => None
@@ -196,7 +196,7 @@ trait JsonSchemas extends algebra.JsonSchemas:
196196
* has a [[docs @docs]] annotation, it is used as a description,
197197
* otherwise the schema has no description.
198198
*/
199-
inline def summonDescription[A]: Option[String] =
199+
private[generic] inline def summonDescription[A]: Option[String] =
200200
summonFrom {
201201
case annotation: Annotation[`docs`, A] => Some(annotation().text)
202202
case _ => None
@@ -344,7 +344,7 @@ private object Defaults:
344344
type DefaultValues = defaultValuesType
345345
val defaultValues: DefaultValues = $defaultValuesValue
346346
}
347-
case _ => report.throwError(s"Invalid type ${tpe.show}. Expecting a case class.")
347+
case _ => report.errorAndAbort(s"Invalid type ${tpe.show}. Expecting a case class.")
348348
end summonDefaultsMacro
349349

350350
end Defaults

0 commit comments

Comments
 (0)