Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an argument to CollectionOf() #1232

Merged
merged 2 commits into from May 20, 2017
Merged

Conversation

tchssk
Copy link
Member

@tchssk tchssk commented May 19, 2017

It makes it possible to specify the collection identifier.

It makes it possible to specify the collection identifier.
@tchssk tchssk requested a review from raphael May 19, 2017 14:19
@tchssk
Copy link
Member Author

tchssk commented May 19, 2017

I don't know why travis was failed :(

Copy link
Member

@raphael raphael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look great! I just suggested some tweaks to the comments, thank you.

for _, p := range paramAndDSL {
param, ok = p.(string)
if !ok {
dslengine.ReportError("invalid CollectionOf argument, must be a string", p)

This comment was marked as off-topic.

})
})

Context("defined with the collectio identifier", func() {

This comment was marked as off-topic.

func CollectionOf(v interface{}, apidsl ...func()) *design.MediaTypeDefinition {
//
// CollectionOf(BottleMedia) // If the identifier of BottleMedia is "vnd.goa.bottle',
// // Content-Type will be "vnd.goa.bottle; type=collection".

This comment was marked as off-topic.

@@ -376,9 +376,17 @@ func Link(name string, view ...string) {
// CollectionOf creates a collection media type from its element media type. A collection media

This comment was marked as off-topic.

@@ -376,9 +376,17 @@ func Link(name string, view ...string) {
// CollectionOf creates a collection media type from its element media type. A collection media
// type represents the content of responses that return a collection of resources such as "list"
// actions. This function can be called from any place where a media type can be used.
//
// The resulting media type identifier is built from the element media type by appending the media

This comment was marked as off-topic.

//
// The collection identifier can be specified as second argument.
//
// CollectionOf(BottleMedia, "vnd.goa.bottles") // Content-Type will be "vnd.goa.bottles".

This comment was marked as off-topic.

@tchssk
Copy link
Member Author

tchssk commented May 20, 2017

I added a fixing commit!

Copy link
Member

@raphael raphael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@raphael raphael merged commit 4a938b3 into goadesign:master May 20, 2017
@raphael
Copy link
Member

raphael commented May 20, 2017

Would you mind backporting this to v1? Thank you!

tchssk added a commit to tchssk/goa that referenced this pull request May 21, 2017
* Add an argument to CollectionOf()

It makes it possible to specify the collection identifier.

* Fix documents and a test description
raphael pushed a commit that referenced this pull request May 21, 2017
* Add an argument to CollectionOf()

It makes it possible to specify the collection identifier.

* Fix documents and a test description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants