Skip to content

Commit

Permalink
Revert "fix (Typings): Remove optional member fields #42 TADA"
Browse files Browse the repository at this point in the history
This reverts commit 83c6aaa.
  • Loading branch information
cnguy committed Mar 16, 2019
1 parent aac2e81 commit 8eec337
Show file tree
Hide file tree
Showing 5 changed files with 375 additions and 5,162 deletions.
17 changes: 0 additions & 17 deletions _scripts/generate_ts_from_swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,11 @@ import request from 'request'
const sw2dts = require('sw2dts')
import fs from 'fs'
import path from 'path'
import yaml from 'js-yaml'

import SWAGGER_URL from './swagger_url'

const TS_FILE_PATH = path.join(__dirname, '..', 'typings', 'dtos.ts')

// Remove this later
try {
const config = yaml.safeLoad(
fs.readFileSync('./_scripts/swaggerspec-2.0.yml', 'utf8'),
)
const indentedJson = JSON.stringify(config, null, 4)
sw2dts.convert(JSON.parse(indentedJson)).then(data => {
fs.writeFileSync(TS_FILE_PATH, data)
console.log('done')
})
} catch (e) {
console.log(e)
}

/*
request(SWAGGER_URL, (err, res) => {
if (res) {
sw2dts.convert(JSON.parse(res.body)).then(data => {
Expand All @@ -31,4 +15,3 @@ request(SWAGGER_URL, (err, res) => {
})
}
})
*/
Loading

0 comments on commit 8eec337

Please sign in to comment.