Skip to content

Inappropriate recursion? #7

@Quafadas

Description

@Quafadas
  case class File(
      id: String,
      `object`: String,
      bytes: Long,
      created_at: Long,
      filename: String,
      purpose: String
  ) derives Schema

  case class FileList(
      data: List[File],
      `object`: String
  ) derives Schema

gives;

io.github.quafadas.dairect.filesApi#FileList: Found invalid shape recursion: io.github.quafadas.dairect.filesApi#FileList$data > io.github.quafadas.dairect.filesApi#FileList. A structure cannot be mutually recursive through all required members.

My naive reading of the deriving codebase suggests this is to do with a collision when autogenerating smithy collection shape names. With this information, a simple workaround (note the y appended) is;

  case class FileListy(
      data: List[File],
      `object`: String
  ) derives Schema

Recorded for posterity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions