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

Use normalized JSON representation internally #143

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

richcarl
Copy link
Collaborator

Allows the input spec to use either atoms or binaries as map keys. E.g., if parsing an external JSON file instead of using inline Erlang maps in the handler modules, the default behaviour would be not to create atoms for keys. Similarly, all string values are normalized to binaries. This makes it easy to look up a key and check its value.

Copy link
Member

@elbrujohalcon elbrujohalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small things only.

src/cowboy_swagger.erl Outdated Show resolved Hide resolved
src/cowboy_swagger.erl Outdated Show resolved Hide resolved
src/cowboy_swagger.erl Outdated Show resolved Hide resolved
Allows the input spec to use either atoms or binaries as map keys.
E.g., if parsing an external JSON file instead of using inline Erlang
maps in the handler modules, the default behaviour would be not to
create atoms for keys. Similarly, all string values are normalized to
binaries. This makes it easy to look up a key and check its value.
@elbrujohalcon
Copy link
Member

And now I don't know why we can't run elvis on our code 🤦🏻

@richcarl
Copy link
Collaborator Author

It passes rebar3 test locally now, but I have no idea what's up with the checks now... :-(

@elbrujohalcon
Copy link
Member

Yeah… it also passes locally here… so, I'll merge the PR and accept the mystery.

@elbrujohalcon elbrujohalcon merged commit 0c45030 into inaka:master Oct 17, 2022
@richcarl richcarl deleted the normalize-json branch October 17, 2022 14:43
@richcarl richcarl restored the normalize-json branch October 18, 2022 07:58
@richcarl richcarl deleted the normalize-json branch October 18, 2022 07:58
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 this pull request may close these issues.

2 participants