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

DSL for map[string]interface{} ? #109

Closed
nizsheanez opened this issue Dec 8, 2015 · 6 comments
Closed

DSL for map[string]interface{} ? #109

nizsheanez opened this issue Dec 8, 2015 · 6 comments

Comments

@nizsheanez
Copy link

How to describe design for map[string]interface{} ?

@raphael
Copy link
Member

raphael commented Dec 9, 2015

That's on the list :) For now a workaround is to use String and make the call to json.Unmarshal yourself.

@nizsheanez
Copy link
Author

Do you have some "list"/Roadmap?

@arangamani
Copy link
Member

👍

@raphael
Copy link
Member

raphael commented Dec 10, 2015

There's a "roadmap" in the wiki but it's far from complete (this item is missing for example).

@raphael
Copy link
Member

raphael commented Dec 10, 2015

The PR above adds the type Any to the DSL. This type maps to interface{} in Go so that doing for example:

var Payload = Type("payload", func() {
    Attribute("foo", HashOf(String, Any))
})

will result in the Go struct:

type Payload struct {
    Foo map[string]interface{}
}

@raphael raphael closed this as completed Dec 10, 2015
@nizsheanez
Copy link
Author

cool, look similar to Protobuf 3 https://developers.google.com/protocol-buffers/docs/proto3#any

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

No branches or pull requests

3 participants