New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ts-from-swagger

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-from-swagger - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

4

package.json
{
"name": "ts-from-swagger",
"version": "1.0.2",
"version": "1.0.3",
"description": "Generate TypeScript interfaces and enums quickly and easily from Swagger definition JSON with our lightweight tool. Improve your development workflow by automatically generating type-safe code that's easy to maintain and understand. Say goodbye to manual coding and hello to streamlined development with our Swagger definition Typescript generator.",
"main": "\\",
"bin": "index.js",
"directories": {

@@ -13,2 +14,3 @@ "test": "test"

"gen": "node index https://petstore.swagger.io/v2/swagger.json ./test/src/definitions",
"npxgen": "npx .",
"ts-from-swagger": "npx ts-from-swagger https://petstore.swagger.io/v2/swagger.json ./test/src/definitions"

@@ -15,0 +17,0 @@ },

@@ -11,3 +11,3 @@ # :chopsticks: ts-from-swagger

<img src="https://raw.githubusercontent.com/n4j1Br4ch1D/ts-from-swagger/main/assets/ts-from-swagger.gif" alt="ts-from-swagger" height="600"/>
<img src="https://raw.githubusercontent.com/n4j1Br4ch1D/ts-from-swagger/main/assets/ts-from-swagger.gif" alt="ts-from-swagger" />

@@ -18,3 +18,3 @@ ## Features

- [x] Simple & Easy to use.
- [x] Fetch directly from Swagger json url.
- [x] Fetch directly from Swagger Schema URL.
- [x] Support interfaces and enums.

@@ -24,3 +24,4 @@ - [x] Support required fields.

- [ ] Authorization for Swagger.
- [ ] Supports both Swagger versions 2 & 3.
- [ ] Supports both OpenAPI versions 2 & 3.
- [ ] Supports both JSON & YML.

@@ -119,5 +120,10 @@ ## Install

- Refactor Code.
- Beta Version 1.0.3 : 17/03/2023
- Add simple CLI logs.
- Fix run npx: node v14.21.1 / npm v6.14.17
- [Agenda] Beta Version 1.0.x : xx/03/2023
- Add Authorization.
- Add support for Swagger version 3.
- Add support for YML.
- Fix issue: npx command on later node/npm versions.
```

@@ -124,0 +130,0 @@

@@ -7,2 +7,3 @@ import fs from "fs";

export async function generateInterfaces(swaggerUrl, outputDir) {
console.log("🥢ts-from-swagger: ", "Start generating...!");
return new Promise(async (resolve) => {

@@ -17,2 +18,3 @@ const requester = swaggerUrl.startsWith("http://") ? http : https;

response.on("end", async () => {
console.log("🥢ts-from-swagger: ", "Schema fetched successfully!");
const swagger = await JSON.parse(data);

@@ -94,2 +96,3 @@ const definitions = swagger.definitions;

}
console.log("🥢ts-from-swagger: ", "Definitions generated successfully!");
resolve("resolved");

@@ -99,5 +102,5 @@ });

.on("error", (error) => {
console.error(error);
console.error("🥢ts-from-swagger: ", error);
});
});
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc