├── .github └── workflows │ └── validate.yml ├── natives.json └── schema.json /.github/workflows/validate.yml: -------------------------------------------------------------------------------- 1 | name: Validate JSON 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | verify-json-validation: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Validate JSON 11 | uses: docker://orrosenblatt/validate-json-action:latest 12 | env: 13 | INPUT_SCHEMA: ./schema.json 14 | INPUT_JSONS: ./natives.json -------------------------------------------------------------------------------- /schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "patternProperties": { 4 | "^([A-Z_]+[A-Z0-9_]*|_0x[0-9A-F]{16})$": { 5 | "type": "object", 6 | "patternProperties": { 7 | "^0x[0-9A-F]{16}$": { 8 | "type": "object", 9 | "properties": { 10 | "name": { "$ref": "#/$defs/native_name" }, 11 | "comment": { "type": "string" }, 12 | "params": { 13 | "type": "array", 14 | "items": { 15 | "type": "object", 16 | "properties": { 17 | "type": { "$ref": "#/$defs/param_type" }, 18 | "name": { 19 | "type": "string", 20 | "pattern": "^([A-Za-z_]+[A-Za-z0-9_]*|\\.\\.\\.)$" 21 | } 22 | }, 23 | "required": ["type", "name"], 24 | "additionalProperties": false 25 | } 26 | }, 27 | "return_type": { "$ref": "#/$defs/return_type" }, 28 | "build": { "type": "string" }, 29 | "variadic": { "type": "boolean" }, 30 | "unused": { "type": "boolean" }, 31 | "gta_hash": { 32 | "type": "string", 33 | "pattern": "^0x[0-9A-F]{16}$" 34 | }, 35 | "gta_jhash": { 36 | "type": "string", 37 | "pattern": "^($|0x[0-9A-F]{8})$" 38 | } 39 | }, 40 | "required": ["name", "comment", "params", "return_type", "build"], 41 | "dependencies": { 42 | "gta_hash": ["gta_jhash"] 43 | }, 44 | "additionalProperties": false 45 | } 46 | }, 47 | "additionalProperties": false 48 | } 49 | }, 50 | "additionalProperties": false, 51 | "$defs": { 52 | "native_name": { 53 | "type": "string", 54 | "pattern": "^([A-Z_]+[A-Z0-9_]*|_0x[0-9A-F]{16})$" 55 | }, 56 | "param_type": { 57 | "type": "string", 58 | "enum": [ 59 | "", 60 | "int", "int*", 61 | "float", "float*", 62 | "BOOL", "BOOL*", 63 | "char*", "const char*", 64 | "Any", "Any*", 65 | "Blip", "Blip*", 66 | "Cam", "Cam*", 67 | "Entity", "Entity*", 68 | "FireId", "FireId*", 69 | "Hash", "Hash*", 70 | "Interior", "Interior*", 71 | "ItemSet", "ItemSet*", 72 | "Object", "Object*", 73 | "Ped", "Ped*", 74 | "Pickup", "Pickup*", 75 | "Player", "Player*", 76 | "ScrHandle", "ScrHandle*", 77 | "Vector3*", 78 | "Vehicle", "Vehicle*", 79 | "AnimScene", "AnimScene*", 80 | "PersChar", "PersChar*", 81 | "PopZone", "PopZone*", 82 | "Prompt", "Prompt*", 83 | "PropSet", "PropSet*", 84 | "Volume", "Volume*" 85 | ] 86 | }, 87 | "return_type": { 88 | "type": "string", 89 | "enum": ["void", "int", "float", "BOOL", "const char*", "Any", "Any*", "Blip", "Cam", "Entity", "FireId", "Hash", "Interior", "ItemSet", "Object", "Ped", "Pickup", "Player", "ScrHandle", "Vector3", "Vehicle", "AnimScene", "PersChar", "PopZone", "Prompt", "PropSet", "Volume"] 90 | } 91 | } 92 | } --------------------------------------------------------------------------------