Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions codegen/src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class Codegen {
`#ifndef RPCINTERFACE_H
#define RPCINTERFACE_H\n
#include <jsonrpccxx/server.hpp>
#include <map>
#include <optional>
#include <string>
#include <vector>\n
Expand Down Expand Up @@ -215,6 +216,10 @@ using namespace jsonrpccxx;\n`;
if (item.properties) {
tsType = this.getTypeName(name, suffix);
cppType = `${prefix ?? ''}${tsType}`;
} else if (item.additionalProperties) {
const {cpp, ts} = this.getType(name, item.additionalProperties, suffix);
tsType = `Record<string, ${ts}>`;
cppType = `map<string, ${cpp}>`;
} else {
console.error('unknown type:', item.type);
}
Expand Down