Skip to content

confusing docs for BuildsFrom #149

Description

@jeffwillette

I am a bit confused on what I should do with BuildsFrom since the docs seem to say that I can put a raw type identifier in there...

DOCS

func BuildsFrom

func BuildsFrom(dsl func())
BuildsFrom informs Gorma that this model will be populated from a Goa UserType. Conversion functions will be generated to convert from the payload to the model.

Usage: BuildsFrom(YourType)

Fields not in YourType that you want in your model must be added explicitly with the Field DSL.

If I try BuildsFrom(Type) I get the following error:

/design/models_design.go:61: cannot use Document (type *design.UserTypeDefinition) as type func() in argument to dsl.BuildsFrom

I know BuildsFrom is generally used like below, but would like some clarification

BuildsFrom(func() {
    Payload("[resource]", "[action]")
})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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