Skip to content

code gen should avoid using *string in generated API spec #417

@TimShi

Description

@TimShi

Description

code gen should avoid using *string in generated API spec. This makes it inconvenient to use the string value.

Expected Behavior

expected generated code to use string

type RequestItem struct {
	FirstName string `json:"firstName" binding:"required,max=128"`
	LastName  string `json:"lastName" binding:"required,max=128"`
}

Actual Behavior

type RequestItem struct {
	FirstName *string `json:"firstName" binding:"required,max=128"`
	LastName  *string `json:"lastName" binding:"required,max=128"`
}

Affected Version

v0.14.0

Steps to Reproduce

Follow the README in examples/database to generate code based on contract.

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions