goa_model_gen 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/goa_model_gen/cli.rb +1 -1
- data/lib/goa_model_gen/templates/converter.go.erb +1 -1
- data/lib/goa_model_gen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8acbfbf3f1441f36b014cf90e8f442637a3acf766683fe29f7d7c3adda6a11e9
|
4
|
+
data.tar.gz: 6e2565c972898acfb5fbfbd9430d70aeabe8c13cb386e9b0915b24f1193dee04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91b451a21d658126db5bdc729c0305088f5c5a9096370fa3241345122505fa7102550608ec60e72ae7df0449d811671918fd12d637b9a59663a149afd7dcd467
|
7
|
+
data.tar.gz: 2d9ddf2229fb5d158e103db041f2b9e1c571bcd9e2b993087cef32eb99517809e531b7050632df098c2791b6d09070ab92d4a0a5f7ae47898fa527cc4e5576b3
|
data/lib/goa_model_gen/cli.rb
CHANGED
@@ -57,7 +57,7 @@ module GoaModelGen
|
|
57
57
|
def converter(*paths)
|
58
58
|
show_version_if_required
|
59
59
|
load_types_for(paths) do |source_file|
|
60
|
-
generator = new_generator.tap{|g| g.
|
60
|
+
generator = new_generator.tap{|g| g.source_file = source_file }
|
61
61
|
dest = File.join(cfg.controller_dir, File.basename(source_file.yaml_path, ".*") + "_conv.go")
|
62
62
|
if source_file.types.any?{|t| !!t.payload || !!t.media_type}
|
63
63
|
generator.run('templates/converter.go.erb', dest, overwrite: true)
|
@@ -14,7 +14,7 @@ import (
|
|
14
14
|
"<%= config.go_package %>/model"
|
15
15
|
)
|
16
16
|
|
17
|
-
<%- types.select(&:gen_converter?).each do |type| -%>
|
17
|
+
<%- source_file.types.select(&:gen_converter?).each do |type| -%>
|
18
18
|
<%- if type.payload -%>
|
19
19
|
func <%= type.name %>PayloadToModel(payload *app.<%= type.payload_name %>) (*model.<%= type.name %>, error) {
|
20
20
|
model := &model.<%= type.name %>{}
|