~emersion/libjsonschema

d355a3ff64d06e0815f7ed7b65ad719514472002 — Simon Ser 2 years ago 9b6e97b
tool: don't generate first var if there is only a single field
1 files changed, 1 insertions(+), 1 deletions(-)

M tool/main.c
M tool/main.c => tool/main.c +1 -1
@@ 735,7 735,7 @@ static void emit_type_encoder(FILE *f, const struct jsch_schema *schema, const c

		if (schema_is_inextensible_object(schema)) {
			fprintf(f, "{\n");
			if (schema->properties_len > 0 && !is_prop_required(schema->properties[0].key, schema)) {
			if (schema->properties_len > 1 && !is_prop_required(schema->properties[0].key, schema)) {
				fprintf(f, "	bool first = true;\n");
			}
			const struct jsch_schema *parent = schema;