json-gen-c  0.1.5
json-gen-c generate C code for json manipulation
compat_check.c File Reference

Schema compatibility checker implementation. More...

#include "compat/compat_check.h"
#include <stdio.h>
#include <string.h>
#include "struct/struct_parse.h"
#include "utils/sstr.h"
Include dependency graph for compat_check.c:

Classes

struct  compat_ctx
 
struct  check_pair_args
 

Functions

int compat_check (struct hash_map *old_structs, struct hash_map *old_enums, struct hash_map *old_oneofs, struct hash_map *new_structs, struct hash_map *new_enums, struct hash_map *new_oneofs)
 Compare two parsed schemas and print a compatibility report.
 

Detailed Description

Schema compatibility checker implementation.

Function Documentation

◆ compat_check()

int compat_check ( struct hash_map old_structs,
struct hash_map old_enums,
struct hash_map old_oneofs,
struct hash_map new_structs,
struct hash_map new_enums,
struct hash_map new_oneofs 
)

Compare two parsed schemas and print a compatibility report.

Compares structs, enums, and oneofs between the old and new schemas. Reports safe changes (additions, deprecations) and breaking changes (removals, type changes).

Parameters
old_structsHash map of old schema structs.
old_enumsHash map of old schema enums.
old_oneofsHash map of old schema oneofs.
new_structsHash map of new schema structs.
new_enumsHash map of new schema enums.
new_oneofsHash map of new schema oneofs.
Returns
0 if only safe changes, 1 if any breaking changes found.