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

Serve swagger file as JSON instead of YAML #1416

Closed
davidyuk opened this issue Jun 26, 2023 · 9 comments
Closed

Serve swagger file as JSON instead of YAML #1416

davidyuk opened this issue Jun 26, 2023 · 9 comments
Assignees

Comments

@davidyuk
Copy link
Member

davidyuk commented Jun 26, 2023

Before I asked to add "/api" endpoint in consistency with the node and compiler. It has been done. The only issue that remains is the format of the swagger file. In node and compiler, it is plain JSON, but in middleware it is YAML. While there is no difference for most tools working with swagger files, YAML is not supported out-of-the-box in browsers. So serving "/api" as JSON would be more friendly for web developers, the same as it would be consistent with node and compiler. Switching from YAML to JSON is not a breaking change because YAML is a superset of JSON.

https://mainnet.aeternity.io/mdw/api vs https://mainnet.aeternity.io/api?oas3

@sborrazas
Copy link
Contributor

@davidyuk
Copy link
Member Author

Do you need yaml served at https://mainnet.aeternity.io/mdw/v2/api in some case?

@sborrazas
Copy link
Contributor

For backwards compatibility now we are not able to change it

@davidyuk
Copy link
Member Author

Is there a place where JSON can't be used instead of YAML?

The YAML 1.2 specification was published in 2009. Its primary focus was making YAML a strict superset of JSON.

https://yaml.org/spec/1.2.2/#12-yaml-history

@sborrazas
Copy link
Contributor

It would still break those clients that are expecting a YAML under that path

@davidyuk
Copy link
Member Author

yep, but every JSON is a valid YAML document, does somebody have a self-written yaml parser that not based on the yaml spec?

@sborrazas
Copy link
Contributor

@davidyuk I wasn't really sure the standard covered entirely every json file, but you're right. I'll try updating it and if anyone complains we can revert it back

@sborrazas sborrazas reopened this Jul 28, 2023
sborrazas added a commit that referenced this issue Jul 28, 2023
All valid JSON files are also YAML files

refs #1416
sborrazas added a commit that referenced this issue Jul 28, 2023
All valid JSON files are also YAML files

refs #1416
sborrazas added a commit that referenced this issue Jul 28, 2023
All valid JSON files are also YAML files

refs #1416
sborrazas added a commit that referenced this issue Jul 31, 2023
All valid JSON files are also YAML files

refs #1416
@davidyuk
Copy link
Member Author

davidyuk commented Aug 1, 2023

Thank you! Sorry if I'm being too scrupulous

@sborrazas
Copy link
Contributor

Added and deployed

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

No branches or pull requests

2 participants