Skip to content

Commit

Permalink
Merge pull request #126 from glickbot/glickbot/handle-type-any
Browse files Browse the repository at this point in the history
handle 'any' type
  • Loading branch information
timburks authored Jun 2, 2019
2 parents d18fd27 + a221e9d commit 0a2f4f0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 37 deletions.
2 changes: 2 additions & 0 deletions plugins/gnostic-go-generator/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ func (language *GoLanguageModel) Prepare(model *surface.Model) {
}
case "object":
f.NativeType = "interface{}"
case "any":
f.NativeType = "interface{}"
case "string":
f.NativeType = "string"
default:
Expand Down
2 changes: 2 additions & 0 deletions surface/model_openapiv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ func (b *OpenAPI3Builder) typeForSchema(schema *openapiv3.Schema) (kind FieldKin
if schema.AdditionalProperties == nil {
return FieldKind_MAP, "object", format
}
case "any":
return FieldKind_ANY, "any", format
default:

}
Expand Down
77 changes: 40 additions & 37 deletions surface/surface.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions surface/surface.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ enum FieldKind {
MAP = 1;
ARRAY = 2;
REFERENCE = 3;
ANY = 4;
}

enum TypeKind {
Expand Down

0 comments on commit 0a2f4f0

Please sign in to comment.