Coder Social home page Coder Social logo

Comments (1)

drwpow avatar drwpow commented on May 16, 2024 1

Yes this was something we actually had in V1! And it was a conscious decision to omit in V2. Reason is that Swagger definitions allow for more weird characters like . and - in names which aren’t safe for JS references. And that is kind of a rabbit hole transforming names to be “JS safe” in a way that might introduce bugs and collisions with a big enough API definition.

So we decide to let your schema be your schema, and preserve your names perfectly. If you need shortcuts, consider having some schema.ts file like so:

import { definitions } from './openapi.ts';

export type MySchema = definitions['components']['MySchema'];
// rinse and repeat for anything needed.

This is better because you manage the naming of everything, and aren’t blocked by a library bug if something was renamed improperly. Hope this helps!

from openapi-typescript.

Related Issues (20)

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.