Last active
          September 2, 2025 07:52 
        
      - 
      
 - 
        
Save miguelramos/830619c25af97d27fc785c693e964c78 to your computer and use it in GitHub Desktop.  
    Json Echo mock server json schema
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "$schema": "http://json-schema.org/draft-07/schema#", | |
| "$id": "https://example.com/api-config.schema.json", | |
| "title": "Json Echo Configuration Schema", | |
| "description": "Json Echo Schema api conmfiguration.", | |
| "type": "object", | |
| "properties": { | |
| "port": { | |
| "type": "integer", | |
| "description": "Server port" | |
| }, | |
| "hostname": { | |
| "type": "string", | |
| "description": "Hostname" | |
| }, | |
| "routes": { | |
| "type": "object", | |
| "description": "Routes mapping and configs", | |
| "patternProperties": { | |
| "^/.*": { | |
| "type": "object", | |
| "properties": { | |
| "method": { | |
| "type": "string", | |
| "enum": ["GET", "POST", "PUT", "DELETE", "PATCH"], | |
| "description": "Http method for the route" | |
| }, | |
| "id_field": { | |
| "type": "string", | |
| "description": "ID field" | |
| }, | |
| "results_field": { | |
| "type": "string", | |
| "description": "Body custom field where results/data are appended" | |
| }, | |
| "description": { | |
| "type": "string", | |
| "description": "Route description" | |
| }, | |
| "headers": { | |
| "type": "object", | |
| "description": "Headers for the http route" | |
| }, | |
| "response": { | |
| "type": ["string", "object"], | |
| "description": "Body response or file path", | |
| "properties": { | |
| "status": { | |
| "type": "integer", | |
| "description": "Http status code" | |
| }, | |
| "body": { | |
| "type": "object", | |
| "description": "Data response" | |
| } | |
| }, | |
| "required": ["status", "body"], | |
| "additionalProperties": false | |
| } | |
| }, | |
| "required": ["method", "description"], | |
| "additionalProperties": false | |
| } | |
| }, | |
| "additionalProperties": false | |
| } | |
| }, | |
| "required": ["port", "hostname", "routes"] | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment