Updated docs for NewDocument

fixed issue #297
This commit is contained in:
quobix
2024-07-08 10:24:40 -04:00
parent 721e869fe8
commit c9155f7ef3

View File

@@ -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 // 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. // 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. // This function will NOT automatically follow (meaning load) any file or remote references that are found.
// Which means recursively also, like a spider, it will follow every reference found, local or remote.
// //
// If this isn't the behavior you want, or that you feel this is a potential security risk, // If this isn't the behavior you want, then you can use the NewDocumentWithConfiguration() function instead, which allows you to set a configuration that
// 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`
// will allow you to control if file or remote references are allowed. // properties.
func NewDocument(specByteArray []byte) (Document, error) { func NewDocument(specByteArray []byte) (Document, error) {
return NewDocumentWithTypeCheck(specByteArray, false) return NewDocumentWithTypeCheck(specByteArray, false)
} }