Is there any tool to generate JavaScript classes from a YAML ?
I have a swagger YAML and I want to generate javascript models that look like this :
'use strict';
function Product(name,description){
this.name = name;
this.description = description;
this.toString = function(){
return this.name+" : "+this.description;
}
}
using the swagger YAML :
.
.
.
definitions:
product:
properties:
name:
type: string
description:
type: string
required:
- name
- description
.
.
.
You can use Swagger Codegen to generate JS API clients (with models), clients in other langauges (e.g. Ruby, Typescript, etc), server stubs (e.g. NodeJS, Java Spring, etc) and API documentation.
Given that you already have the OpenAPI/Swagger spec, you can do the following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With