File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
reverse_engineering/helpers Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -564,14 +564,27 @@ const setMissedType = (schema) => {
564564 return schema ;
565565}
566566
567+ const convertFormatToMode = schema => {
568+ switch ( schema . type ) {
569+ case 'number' :
570+ case 'integer' : {
571+ const { format, ...schemaData } = schema ;
572+
573+ return { ...schemaData , mode : format } ;
574+ }
575+ default :
576+ return schema ;
577+ }
578+ } ;
579+
567580const handleSchemaProps = ( schema , fieldOrder ) => {
568581 if ( ! schema ) {
569582 schema = {
570583 type : 'object'
571584 } ;
572585 }
573586
574- const fixedSchema = setMissedType ( schema ) ;
587+ const fixedSchema = convertFormatToMode ( setMissedType ( schema ) ) ;
575588 const schemaWithAdditionalPropertiesData = handleAdditionalProperties ( fixedSchema ) ;
576589 const schemaWithChoices = handleSchemaChoices ( schemaWithAdditionalPropertiesData , fieldOrder ) ;
577590 const reorderedSchema = commonHelper . reorderFields ( schemaWithChoices , fieldOrder ) ;
@@ -608,7 +621,7 @@ const handleDefinitionSchemaProps = (schema, fieldOrder) => {
608621 } ;
609622 }
610623
611- const fixedSchema = setMissedType ( schema ) ;
624+ const fixedSchema = convertFormatToMode ( setMissedType ( schema ) ) ;
612625 const schemaWithAdditionalPropertiesData = handleAdditionalProperties ( fixedSchema ) ;
613626 const reorderedSchema = commonHelper . reorderFields ( schemaWithAdditionalPropertiesData , fieldOrder ) ;
614627 const schemaWithHandledProperties = Object . keys ( reorderedSchema ) . reduce ( ( accumulator , property ) => {
You can’t perform that action at this time.
0 commit comments