Skip to content
Discussion options

You must be logged in to vote

You're almost there! The missing piece is the Build() call on the low-level schema. BuildModel() only handles simple scalar fields via reflection. Build() is what processes the complex nested structures like properties, type, polymorphic keywords.

  import (
        "context"

        highbase "github.com/pb33f/libopenapi/datamodel/high/base"
        "github.com/pb33f/libopenapi/datamodel/low"
        lowbase "github.com/pb33f/libopenapi/datamodel/low/base"
        v3 "github.com/pb33f/libopenapi/datamodel/high/v3"
        "github.com/pb33f/libopenapi/orderedmap"
        "go.yaml.in/yaml/v4"
  )

  // Unmarshal your partial YAML into a yaml.Node tree
  var rootNode yaml.Node
  if err := yaml

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@danielshiplett
Comment options

Answer selected by danielshiplett
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants