We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26b778b commit 75b6c3bCopy full SHA for 75b6c3b
1 file changed
reverse_engineering/helpers/adaptJsonSchema.js
@@ -20,6 +20,10 @@ const adaptType = field => {
20
return adaptMultiple(field);
21
}
22
23
+ if (type === 'string') {
24
+ return handleString(field);
25
+ }
26
+
27
if (type === 'number') {
28
return handleNumber(field);
29
@@ -253,4 +257,16 @@ const convertToValidAvroName = name => {
253
257
return name.replace(/[^A-Za-z0-9_]/g, '_');
254
258
};
255
259
260
+const handleString = field => {
261
+ if (Array.isArray(field.enum) && field.enum.length > 0) {
262
+ return {
263
+ ...field,
264
+ type: 'enum',
265
+ symbols: field.enum,
266
+ };
267
268
269
+ return field;
270
+};
271
256
272
module.exports = { adaptJsonSchema, adaptJsonSchemaName };
0 commit comments