Skip to content

Commit

Permalink
Updated docs for NewDocument
Browse files Browse the repository at this point in the history
fixed issue #297
  • Loading branch information
daveshanley committed Jul 8, 2024
1 parent 721e869 commit c9155f7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions document.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,11 @@ type DocumentModel[T v2high.Swagger | v3high.Document] struct {
// After creating a Document, the option to build a model becomes available, in either V2 or V3 flavors. The models
// are about 70% different between Swagger and OpenAPI 3, which is why two different models are available.
//
// This function will automatically follow (meaning load) any file or remote references that are found anywhere.
// Which means recursively also, like a spider, it will follow every reference found, local or remote.
// This function will NOT automatically follow (meaning load) any file or remote references that are found.
//
// If this isn't the behavior you want, or that you feel this is a potential security risk,
// then you can use the NewDocumentWithConfiguration() function instead, which allows you to set a configuration that
// will allow you to control if file or remote references are allowed.
// If this isn't the behavior you want, then you can use the NewDocumentWithConfiguration() function instead, which allows you to set a configuration that
// will allow you to control if file or remote references are allowed. In particular the `AllowFileReferences` and `FollowRemoteReferences`
// properties.
func NewDocument(specByteArray []byte) (Document, error) {
return NewDocumentWithTypeCheck(specByteArray, false)
}
Expand Down

0 comments on commit c9155f7

Please sign in to comment.