{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "service.yaml",
    "type": "object",
    "properties": {
        "versions": {
            "type": "array",
            "items": {
                "$ref": "#/$defs/ServiceYamlVersion"
            },
            "description": "The API versions of the service, ordered oldest to newest."
        }
    },
    "required": [
        "versions"
    ],
    "$defs": {
        "ServiceYamlVersion": {
            "type": "object",
            "properties": {
                "version": {
                    "type": "string",
                    "description": "The API version value (e.g. `2023-11-01`)."
                },
                "source": {
                    "anyOf": [
                        {
                            "type": "string",
                            "const": "typespec"
                        },
                        {
                            "type": "string",
                            "const": "swagger"
                        }
                    ],
                    "description": "Whether this version is generated from TypeSpec or is a legacy swagger version."
                },
                "swagger-files": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "Paths to the swagger/openapi file(s) for this version, relative to `service.yaml`."
                }
            },
            "required": [
                "version",
                "source",
                "swagger-files"
            ],
            "description": "A single API version entry in a `service.yaml` manifest."
        }
    }
}