Skip to content

Commit

Permalink
fix: Update how additionalProperties are generated for markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ksentak committed Oct 23, 2024
1 parent 1c6ca7e commit 022363b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions languages/markdown/templates/schemas/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ ${schema.description}
${schema.shape}
```

Additional properties: ${schema.additionalProperties}

See also: ${schema.seeAlso}

---
1 change: 1 addition & 0 deletions languages/markdown/templates/types/additionalProperties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[property: string]: ${type}
6 changes: 0 additions & 6 deletions src/macrofier/engine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -945,12 +945,6 @@ function generateSchemas(json, templates, options) {
content = content.replace(/\$\{schema.example\}/, schema.examples.map(ex => JSON.stringify(ex, null, ' ')).join('\n\n'))
}

if (schema.additionalProperties) {
content = content.replace(/\$\{schema.additionalProperties\}/, JSON.stringify(schema.additionalProperties, null, ' '))
} else {
content = content.replace(/.*\$\{schema.additionalProperties\}/, '')
}

let seeAlso = getRelatedSchemaLinks(schema, json, templates, options)
if (seeAlso) {
content = content.replace(/\$\{schema.seeAlso\}/, '\n\n' + seeAlso)
Expand Down

0 comments on commit 022363b

Please sign in to comment.