Skip to content

Commit a1e1c4c

Browse files
authored
Merge pull request #211 from swisspost/develop
Release 0.9.34
2 parents 18256a0 + d0e80fa commit a1e1c4c

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

npm-shrinkwrap.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apikana",
3-
"version": "0.9.33",
3+
"version": "0.9.34",
44
"description": "Integrated tools for REST API design - アピ",
55
"main": "index.js",
66
"bin": {

src/generate-schema.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
log.info('Found definition', colors.magenta(name));
2525
var schema = schemas[name];
2626
var v3 = handleAllOf(schema);
27+
unquoteEnumValues(schema);
2728
removeDefinitions(schema);
2829
replaceLocalRef(schema);
2930
replaceLocalRef(v3);
@@ -154,6 +155,16 @@ module.exports = {
154155
}
155156
}
156157

158+
function unquoteEnumValues(schema) {
159+
if (schema.enum) {
160+
schema.enum = schema.enum.map(v => v
161+
.replace(/^"/, "")
162+
.replace(/^'/, "")
163+
.replace(/"$/, "")
164+
.replace(/'$/, ""));
165+
}
166+
}
167+
157168
function removeDefinitions(schema) {
158169
for (var type in schema.definitions) {
159170
var info = schemaInfos[type];

0 commit comments

Comments
 (0)