-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema_codegen.yaml
More file actions
128 lines (128 loc) · 3.15 KB
/
schema_codegen.yaml
File metadata and controls
128 lines (128 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Declarative JSON Schema -> Python model generation targets.
---
defaults:
generator:
input_file_type: jsonschema
output_model_type: pydantic_v2.BaseModel
target_python_version: "3.14"
use_annotated: true
use_union_operator: true
use_standard_collections: true
use_exact_imports: true
field_constraints: true
snake_case_field: true
capitalise_enum_members: true
use_schema_description: true
use_field_description: true
formatters:
- ruff-format
- ruff-check
sources:
github-workflow-schema:
kind: url
uri: https://json.schemastore.org/github-workflow.json
format: json
nix-vendored-schemas:
kind: directory
path: lib/nix/schemas
include:
- "*.yaml"
format: yaml
codegen-manifest-schemas:
kind: directory
path: schemas/codegen
include:
- "*.json"
format: json
registry_profiles:
autodetect:
resource:
mode: from-contents
aliases:
- source-uri
- internal-id
registry:
crawl: true
retrieve:
kind: none
draft4-vendored:
resource:
mode: from-contents
default_specification: http://json-schema.org/draft-04/schema#
aliases:
- relative-path
- basename
- internal-id
registry:
crawl: true
retrieve:
kind: none
local-relative:
resource:
mode: from-contents
aliases:
- relative-path
- basename
- internal-id
registry:
crawl: true
retrieve:
kind: none
targets:
codegen-manifest-models:
sources:
- codegen-manifest-schemas
registry_profile: local-relative
entrypoints:
- ./codegen.schema.json
- ./codegen-lock.schema.json
prepare:
dereference: inline-refs
merge_ref_siblings: false
generator:
output: lib/schema_codegen/models/_generated.py
github-actions:
sources:
- github-workflow-schema
registry_profile: autodetect
entrypoints:
- https://json.schemastore.org/github-workflow.json
prepare:
dereference: inline-refs
merge_ref_siblings: false
python_transforms:
- rewrite-constr-annotations
- normalize-pydantic-imports
generator:
output: lib/github_actions/models/_generated.py
nix-models:
sources:
- nix-vendored-schemas
registry_profile: draft4-vendored
entrypoints:
- ./hash-v1.yaml
- ./store-path-v1.yaml
- ./content-address-v1.yaml
- ./file-system-object-v1.yaml
- ./build-trace-entry-v2.yaml
- ./build-result-v1.yaml
- ./deriving-path-v1.yaml
- ./derivation-v4.yaml
- ./derivation-options-v1.yaml
- ./store-object-info-v2.yaml
prepare:
dereference: inline-refs
merge_ref_siblings: true
schema_transforms:
- inline-mergeable-allof
- const-null-to-type-null
- drop-description
python_transforms:
- rewrite-constr-annotations
- normalize-pydantic-imports
generator:
output: lib/nix/models/_generated.py
use_schema_description: false
use_field_description: false
use_one_literal_as_default: true
use_default_kwarg: true