Skip to content

go schema generator fails when generating formatted string fields #312

Description

@bakito

What happened?

My XRD Shema defines an email formatted string arrayfield.
This field is generated as *[]openapi_types.Email

Using this formats, the generated schema files will not compile due to 2 issues.

  1. the import openapi_types "github.com/oapi-codegen/runtime/types" is missing
  2. the openapi_types.Email does not implement the DeepCopyInto func

How can we reproduce it?

Create a XRD defining a string array field with format email.

members:
  type: array
  description: Member principal namees for the group
  items:
    type: string
    format: email
    pattern: '^[^@\s]+@[^@\s]+\.[^@\s]+$'

Put the XRD into apis/my-yrd/definition.yaml

Run crossplane project build

What environment did it happen in?

  • Crossplane CLI version: v2.5.0
  • Platform (e.g., linux/amd64): linux/amd64
  • Crossplane version (if applicable): not relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions