Skip to content

Commit

Permalink
Add docs for JSON Schema (#2120)
Browse files Browse the repository at this point in the history
  • Loading branch information
bterlson authored Jun 27, 2023
1 parent 0c923b8 commit 411700a
Show file tree
Hide file tree
Showing 10 changed files with 482 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/json-schema",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/json-schema"
}
23 changes: 13 additions & 10 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions docs/standard-library/json-schema/reference/data-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: "Data types"
toc_min_heading_level: 2
toc_max_heading_level: 3
---

# Data types

## TypeSpec.JsonSchema

### `Json` {#TypeSpec.JsonSchema.Json}

Specify that the provided template argument should be emitted as raw JSON or YAML
as opposed to a schema. Use in combination with the

```typespec
model TypeSpec.JsonSchema.Json<T>
```

#### Template Parameters

| Name | Description |
| ---- | ------------------------------- |
| T | the type to convert to raw JSON |

### `Format` {#TypeSpec.JsonSchema.Format}

Well-known JSON Schema formats.

```typespec
enum TypeSpec.JsonSchema.Format
```
Loading

0 comments on commit 411700a

Please sign in to comment.