You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: marshaller/coremodel.go
+19-4Lines changed: 19 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -24,13 +24,16 @@ type CoreModeler interface {
24
24
SetConfig(config*yml.Config)
25
25
GetConfig() *yml.Config
26
26
Marshal(ctx context.Context, w io.Writer) error
27
+
SetUnknownProperties(props []string)
28
+
GetUnknownProperties() []string
27
29
}
28
30
29
31
typeCoreModelstruct {
30
-
RootNode*yaml.Node// RootNode is the node that was unmarshaled into this model
31
-
Validbool// Valid indicates whether the model passed validation, ie all its required fields were present and ValidYaml is true
32
-
ValidYamlbool// ValidYaml indicates whether the model's underlying YAML representation is valid, for example a mapping node was received for a model
33
-
Config*yml.Config// Generally only set on the top-level model that was unmarshaled
32
+
RootNode*yaml.Node// RootNode is the node that was unmarshaled into this model
33
+
Validbool// Valid indicates whether the model passed validation, ie all its required fields were present and ValidYaml is true
34
+
ValidYamlbool// ValidYaml indicates whether the model's underlying YAML representation is valid, for example a mapping node was received for a model
35
+
Config*yml.Config// Generally only set on the top-level model that was unmarshaled
36
+
UnknownProperties []string// UnknownProperties lists property keys that were present in the YAML but not defined in the model (excludes extensions which start with "x-")
- Removes unknown properties not defined in the OpenAPI specification
246
+
247
+
**Configuration File Support:**
248
+
249
+
Create a YAML configuration file to control sanitization behavior:
250
+
251
+
```yaml
252
+
# sanitize-config.yaml
253
+
254
+
# Only remove extensions that match these patterns, null will remove ALL extensions, [] will remove no extensions (default: null, removes ALL extensions)
0 commit comments