Code Monkey home page Code Monkey logo

Comments (1)

tantialex avatar tantialex commented on August 16, 2024

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

The lack of a functionality of a third-party tool should not impact the content of the core swagger file. Therefore, the ideal solution is for the third-party tool to support oneOf and anyOf tags.

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

This is a design of the API not the swagger implementation.

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.

Response schema are only moved to the components sections when the schema is used more than once in multiple endpoints, to avoid redundancy.

Overall, the swagger implementation is not intended to be defined by third-party tools.

from binance-api-swagger.

Related Issues (10)

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.