Skip to content

Comments

Fix on PR: #888 RFC: [go] define "any-type" schema as an empty interface in generated go code.#3878

Closed
mattiabertorello wants to merge 6 commits intoOpenAPITools:masterfrom
bcmi-labs:ashanbrown/any-type
Closed

Fix on PR: #888 RFC: [go] define "any-type" schema as an empty interface in generated go code.#3878
mattiabertorello wants to merge 6 commits intoOpenAPITools:masterfrom
bcmi-labs:ashanbrown/any-type

Conversation

@mattiabertorello
Copy link

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Fix issue point out here: #888 (comment)

@wing328 @ashanbrown @eclipse1985
@antihax (2017/11) @bvwells (2017/12) @grokify (2018/07)

@auto-labeler
Copy link

auto-labeler bot commented Sep 12, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@macjohnny macjohnny requested a review from wing328 September 13, 2019 08:03
@macjohnny macjohnny added this to the 4.1.3 milestone Sep 13, 2019
@macjohnny macjohnny requested a review from grokify September 13, 2019 08:04
@wing328
Copy link
Member

wing328 commented Sep 13, 2019

@mattiabertorello what about using --type-mappings object="interface{}" instead?

if it works, we can add this mapping to the Abstract Go class.

@eclipse1985
Copy link

@mattiabertorello what about using --type-mapping object="interface{}" instead?

if it works, we can add this mapping to the Abstract Go class.

@wing328 Actually seems that with this parameter the generations works pretty good even without adding the mapping to the Abstract Go class. Can you confirm?

@wing328
Copy link
Member

wing328 commented Sep 13, 2019

If it works, we can hard code the mapping in the Abstract Go class rather than supplying this everytime via --type-mapping when running the generator.

@eclipse1985
Copy link

Looks very good to me, but we see that at this commit it was already changed in the past from interface{} to map[string]interface{}. But if you confirm that is ok on your side we fix it exactly as you said.

@wing328
Copy link
Member

wing328 commented Jun 16, 2020

@wing328 wing328 closed this Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants