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

Cannot detect it is multiline string or object #89

Closed
nasa9084 opened this issue Mar 5, 2020 · 0 comments · Fixed by #90
Closed

Cannot detect it is multiline string or object #89

nasa9084 opened this issue Mar 5, 2020 · 0 comments · Fixed by #90

Comments

@nasa9084
Copy link
Contributor

nasa9084 commented Mar 5, 2020

Related to: #75 (fixed by #78)

if the receiver type is interface{} and unmarshaling with UnmarshalYAML([]byte), it seems impossible to detect it is multiline string or object.

e.g. the value in https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/api-with-examples.yaml#L18 and the value in https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/api-with-examples.yaml#L51 have same type but the result of unmarshal is not same, they are defined as interface{} and former one should be unmarshaled to map[string]interface{}, later one should unmarshaled to string

before #78, the passed bytes contains | at first character so we could detect it is string or object

is there any way to detect? (or, should revert the change?)

@nasa9084 nasa9084 changed the title Cannot detect it is multiline string or map Cannot detect it is multiline string or object Mar 5, 2020
@goccy goccy closed this as completed in #90 Mar 7, 2020
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 a pull request may close this issue.

1 participant