API Reference Get syntext.json Schema
Get syntext.json Schema
The JSON Schema for syntext.json and syntext.yml — public and cacheable
Returns the JSON Schema (draft-07) for syntext.json, syntext.yaml and
syntext.yml, generated from the same definition the build validates against.
Point $schema at it to get autocomplete and validation in your editor — see
$schema.
The same document is served at https://syntext.dev/schema/syntext.json,
the URL stx init writes into new projects.
Authentication
None. The endpoint is public and holds no project data.
Caching
| Header | Value |
|---|---|
Content-Type | application/schema+json; charset=utf-8 |
Cache-Control | public, max-age=3600, s-maxage=86400 |
ETag | A hash of the document. Send it back as If-None-Match to get 304 Not Modified |
Access-Control-Allow-Origin | * |
Example
Abbreviated — the full schema describes every key on the syntext.json reference.
Was this page helpful? Yes No
Previous
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl https://api.syntext.dev/v1/schema/syntext.json
const response = await fetch('https://api.syntext.dev/v1/schema/syntext.json', {
method: 'GET',
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.syntext.dev/v1/schema/syntext.json"
response = requests.get(url)
print(response.status_code)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.syntext.dev/v1/schema/syntext.json", nil)
if err != nil {
panic(err)
}
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "net/http"
require "uri"
uri = URI("https://api.syntext.dev/v1/schema/syntext.json")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Get.new(uri)
response = http.request(request)
puts response.code
puts response.body
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.syntext.dev/v1/schema/syntext.json',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.syntext.dev/v1/schema/syntext.json"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.syntext.dev/v1/schema/syntext.json");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://syntext.dev/schema/syntext.json",
"title": "syntext.json",
"description": "Syntext site configuration (syntext.json, syntext.yml or syntext.yaml).",
"type": "object",
"properties": {
"$schema": { "type": "string" },
"name": { "type": "string" },
"theme": { "type": "string" },
"appearance": { "type": "object" }
}
}