2023-11-24 17:27:44 +00:00
|
|
|
#ifndef _BOOTSTRAP_VALIDATOR_H
|
|
|
|
#define _BOOTSTRAP_VALIDATOR_H
|
|
|
|
|
|
|
|
#include "cJSON.h"
|
|
|
|
#include "dyn_array.h"
|
2023-11-25 16:15:30 +00:00
|
|
|
#include "error.h"
|
2023-11-24 17:27:44 +00:00
|
|
|
|
2023-11-25 02:29:14 +00:00
|
|
|
enum FieldType {
|
|
|
|
FT_STRING = 1,
|
2023-11-24 17:27:44 +00:00
|
|
|
};
|
|
|
|
|
2023-11-25 02:29:14 +00:00
|
|
|
struct Field {
|
|
|
|
enum FieldType type;
|
2023-11-25 17:37:41 +00:00
|
|
|
// OWNERSHIP: Does not take ownership.
|
2023-11-24 17:27:44 +00:00
|
|
|
const char *key;
|
2023-11-25 17:37:41 +00:00
|
|
|
// OWNERSHIP: Does not take ownership.
|
2023-11-25 02:29:14 +00:00
|
|
|
const char *prompt;
|
2023-11-24 17:27:44 +00:00
|
|
|
};
|
|
|
|
|
2023-11-25 16:15:30 +00:00
|
|
|
struct Error *validate_spec_json(
|
2023-11-25 02:35:22 +00:00
|
|
|
const cJSON *const parsed, struct DynArray **fields
|
|
|
|
);
|
2023-11-24 17:27:44 +00:00
|
|
|
|
|
|
|
#endif /* _BOOTSTRAP_VALIDATOR_H */
|