Skip to content

Commit

Permalink
update review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
HaseenaSainul committed Jun 13, 2023
1 parent 8303a93 commit 654cae9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion languages/c/templates/imports/common.c

This file was deleted.

2 changes: 1 addition & 1 deletion languages/c/templates/imports/default.c
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#include "JsonData_${info.title}.h"
#include "JsonData_${info.title}.h"
4 changes: 2 additions & 2 deletions src/macrofier/engine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ const generateMacros = (obj, templates, languages, options = {}) => {
const schemasArray = generateSchemas(obj, templates, { baseUrl: '', section: 'schemas' }).filter(s => (options.copySchemasIntoModules || !s.uri))
const accessorsArray = generateSchemas(obj, templates, { baseUrl: '', section: 'accessors' }).filter(s => (options.copySchemasIntoModules || !s.uri))
const schemas = schemasArray.length ? getTemplate('/sections/schemas', templates).replace(/\$\{schema.list\}/g, schemasArray.map(s => s.body).filter(body => body).join('\n')) : ''
const typesArray = schemasArray.length ? schemasArray.filter(x => !x.enum) : ''
const typesArray = schemasArray.length ? schemasArray.filter(x => !x.enum) : []
const types = (typesArray.length ? getTemplate('/sections/types', templates).replace(/\$\{schema.list\}/g, typesArray.map(s => s.body).filter(body => body).join('\n')) : '') + methodTypes

const accessors = (accessorsArray.length ? getTemplate('/sections/accessors', templates).replace(/\$\{schema.list\}/g, accessorsArray.map(s => s.body).filter(body => body).join('\n')) : '') + methodAccessors
Expand Down Expand Up @@ -796,7 +796,7 @@ const generateImports = (json, templates) => {

let componentExternalSchema = getComponentExternalSchema(json)
if (componentExternalSchema.length && json.info['x-uri-titles']) {
imports += componentExternalSchema.map(shared => getTemplate('/imports/common', templates).replace(/\$\{info.title\}/g, shared)).join('')
imports += componentExternalSchema.map(shared => getTemplate('/imports/default', templates).replace(/\$\{info.title\}/g, shared)).join('')
}
return imports
}
Expand Down

0 comments on commit 654cae9

Please sign in to comment.