go schema generator fails when generating formatted string fields
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
Research direction
Reproduce the issue by placing the shown XRD in apis/my-yrd/definition.yaml and running crossplane project build. Inspect the Go schema generator and its generated schema output for the formatted email array field. Done means the generated files compile, include the required runtime import, and handle the generated Email type's DeepCopyInto requirement.
Written by the indexing model from the issue text.
Description
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.
- the import
openapi_types "github.com/oapi-codegen/runtime/types"is missing - the openapi_types.Email does not implement the
DeepCopyIntofunc
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
- Dominant language
- Go
- Stars
- 19
- Forks
- 31
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 53
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from crossplane/cli
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
crossplane/cli#282 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
crossplane/cli#384 ·
-
crossplane/cli#379 · 1 assignee ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 68/100
crossplane/cli#370 · 1 reaction ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 28/100
crossplane/cli#369 ·
Similar issues
-
bug github_actions
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
registrystack/registry-stack#1393 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
JakeChampion/lang#10213 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100