Example #1
0
 /// <summary>
 /// Creates a new internal reference <see cref="OasReferable{T}"/>.
 /// </summary>
 /// <param name="internalReference">The internal reference.</param>
 public OasReferable(JsonPointer internalReference)
 {
     if (internalReference.Count == 0)
     {
         throw new ArgumentOutOfRangeException(nameof(internalReference));
     }
     Value     = default;
     Reference = internalReference;
 }
Example #2
0
 /// <summary>
 /// Creates a new internal reference <see cref="OasReferable{T}"/>.
 /// </summary>
 /// <param name="reference">The reference.</param>
 public OasReferable(OasReference reference)
 {
     if (!reference.HasValue)
     {
         throw new ArgumentOutOfRangeException(nameof(reference));
     }
     Value     = default;
     Reference = reference;
 }
Example #3
0
 /// <summary>
 /// Creates a new external reference <see cref="OasReferable{T}"/>.
 /// </summary>
 /// <param name="url">The external reference URL.</param>
 /// <param name="reference">The external reference pointer.</param>
 public OasReferable(Uri url, JsonPointer reference)
 {
     if (url == null && reference.Count == 0)
     {
         throw new ArgumentNullException(nameof(url));
     }
     Value     = default;
     Reference = new OasReference(url, reference);
 }
Example #4
0
 /// <summary>
 /// Creates a new instance of the <see cref="OasLink"/> class.
 /// </summary>
 /// <param name="operationReference">The relative or absolute reference to an OAS operation.</param>
 /// <param name="operationIdentifier">The name of an existing, resolvable OAS operation, as defined with a unique operation identifier.</param>
 /// <param name="description">The description of the link.</param>
 /// <param name="server">The server object to be used by the target operation.</param>
 public OasLink(
     OasReference operationReference = default,
     string operationIdentifier      = default,
     string description = default,
     OasServer server   = default)
 {
     OperationReference  = operationReference;
     OperationIdentifier = operationIdentifier;
     Description         = description;
     Server = server;
 }
Example #5
0
 /// <summary>
 /// Creates a new value <see cref="OasReferable{T}"/>.
 /// </summary>
 /// <param name="value">The value.</param>
 public OasReferable(T value)
 {
     Value     = value;
     Reference = default;
 }