Skip to content

Commit 5a09940

Browse files
author
Jakub Jankowski
authored
feat: extend annotations (#4)
1 parent 43ffaea commit 5a09940

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/accessors/getAnnotations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { SchemaAnnotations } from '../nodes/types';
22
import type { SchemaFragment } from '../types';
33
import { pick } from '../utils/pick';
44

5-
const ANNOTATIONS: SchemaAnnotations[] = ['description', 'default', 'examples'];
5+
const ANNOTATIONS: SchemaAnnotations[] = ['description', 'default', 'examples', 'const', 'x-example'];
66

77
export function getAnnotations(fragment: SchemaFragment) {
88
return pick(fragment, ANNOTATIONS);

src/nodes/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ export enum SchemaCombinerName {
2525
OneOf = 'oneOf',
2626
}
2727

28-
export type SchemaAnnotations = 'description' | 'default' | 'examples';
28+
export type SchemaAnnotations = 'description' | 'default' | 'examples' | 'const' | 'x-example';
2929

3030
export type SchemaMeta = 'id' | '$schema';

0 commit comments

Comments
 (0)