Code Monkey home page Code Monkey logo

Comments (4)

aisling11 avatar aisling11 commented on August 16, 2024 1

Thank you @performanceArtist, this will be included in next release.

from binance-api-swagger.

aisling11 avatar aisling11 commented on August 16, 2024

Hey @performanceArtist, this project's target is Swagger UI, but we can consider adding more openAPI specs for local code generation use cases.
Everything under schemas is for different responses' json content and all its properties are required. Testing with openapi-typescript tool, it seems to generate all the properties correctly, can you share how you're generating your local code, pls?

from binance-api-swagger.

performanceArtist avatar performanceArtist commented on August 16, 2024

Testing with openapi-typescript tool, it seems to generate all the properties correctly

All the properties in responses[200] section are optional, which is not correct - this is exactly what I was talking about. For example:

        /** Average price */
        200: {
          content: {
            "application/json": {
              mins?: number;
              price?: string;
            };
          };
        };

And here's how the schemas look after generation, everything is also optional:

export interface components {
  schemas: {
    account: {
      makerCommission?: number;
      takerCommission?: number;
      buyerCommission?: number;
      sellerCommission?: number;
      canTrade?: boolean;
      canWithdraw?: boolean;
      canDeposit?: boolean;
      updateTime?: number;
      accountType?: string;
      balances?: {
        asset?: string;
        free?: string;
        locked?: string;
      }[];
    };

Regardless of a generation tool chosen, it should mark these properties as optional, since it is implied by the absence of required.

from binance-api-swagger.

performanceArtist avatar performanceArtist commented on August 16, 2024

we can consider adding more openAPI specs for local code generation use cases

Is there any point in separating? Adding required would only make the spec more accurate. And it should not affect the ui.

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.