goadesign / goadesign/gorma

confusing docs for `BuildsFrom`

Open
#149 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
141
Forks
35
PR merge metrics
No merged PRs in 30d

Description

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]")
})
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.