Code Monkey home page Code Monkey logo

binance-api-swagger's People

Contributors

2pd avatar aisling-2 avatar aisling11 avatar alplabin avatar chairz avatar chairz-2 avatar jonte-z avatar tantialex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

binance-api-swagger's Issues

Required properties

None of the properties in schemas are marked as required, so technically they are all optional. While this is probably not an issue for human readers, it prevents code generators(e.g. typescript definitions generators) from accurately interpreting the spec, assuming that the properties are not actually optional.

Help

Before submitting a new issue, please check if a similar issue has already been filed.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Version of binance-api-swagger
  • Tool name and version [e.g openapi-typescript version 4.4.0]

Additional context
Add any other context about the problem here.

7c5ac90c6f5937fa62c61d73f8255822ac58490d

Before submitting a new issue, please check if a similar issue has already been filed.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Version of binance-api-swagger
  • Tool name and version [e.g openapi-typescript version 4.4.0]

Additional context
Add any other context about the problem here.

missing headers for X-MBX-USED-WEIGHT and Retry-After

the documentation states:

https://binance-docs.github.io/apidocs/spot/en/#limits

IP Limits

Every request will contain X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter) in the response headers which has the current used weight for the IP for all request rate limiters defined.
Each route has a weight which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier weight.
When a 429 is received, it's your obligation as an API to back off and not spam the API.
Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).
IP bans are tracked and scale in duration for repeat offenders, from 2 minutes to 3 days.
A Retry-After header is sent with a 418 or 429 responses and will give the number of seconds required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over.
The limits on the API are based on the IPs, not the API keys.


but when generating the code these headers are missing since not in the spec

Make it possible to generate API client from swagger file

  1. Currently, swagger-codegen doesn't support oneOf and anyOf tags, sot it needed to be manually fixed each time.

  2. Also, it's just stupid to make things this way. For example:
    Endpoint /sapi/v1/accountSnapshot has parameter "type" which is enum with values [SPOT, MARGIN, FUTURES] and depending on its value endpoint returns one of [snapshotSpot, snapshotMargin, snapshotFutures]. Which is.. just madness if you use strong-typed language (using weak/dynamic typed language to trade crypto is madness itself).
    Why don't simple use 3 endpoints with 3 different returning types instead?
    /sapi/v1/accountSnapshotSpot -> snapshotSpot
    /sapi/v1/accountSnapshotMargin -> snapshotMargin
    /sapi/v1/accountSnapshotFutures -> snapshotFutures

  3. No hope you will fix first 2 points, but this one is pretty simple. Please, move inlined responses to the components section. Currently this structures has no names, so swagger-codegen naming it like InlineResponse2005, InlineResponse20054, etc. But when you use a language with types, it is very nice to have not just a variable with some sort of data, but also its type which may be a hint by itself in some cases.

Fetch deposit history - Missing from documentation

The [offset] input parameter to the endpoint [/sapi/v1/capital/deposit/hisrec] / “Fetch deposit history.” is not documented and has no description anywhere - kindly please document it or at least add a simple description.

Release fapi, dapi (and others) in swagger form

question

is this being slated as TODO on your side?
alternatively, is it available anywhere else?

side note

as a side note, this can be partially already done from the Postman definitions in the other repo using this pipeline:

For example for /dapi:

curl https://raw.githubusercontent.com/binance/binance-api-postman/master/collections/Binance%20Coin-M%20Futures%20API.postman_collection.json | postman2openapi | openapi-typescript

the drawbacks here is that the conversion from postman to openapi is lossy as the type info as well as which parameters are optional are lost. Instead everything becomes string, but at least the field names and paths are preserved as well as the comments

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.