private void WriteInternal(IOpenApiWriter writer) { Debug.Assert(writer != null); // { for json, empty for YAML writer.WriteStartObject(); // description writer.WriteRequiredProperty(OpenApiConstants.OpenApiDocDescription, Description); // headers writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocHeaders, Headers); // content writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocContent, Content); // headers writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocLinks, Links); // Extensions writer.WriteDictionary(Extensions); // } for json, empty for YAML writer.WriteEndObject(); }
/// <summary> /// Write media type object to the given writer. /// </summary> /// <param name="writer">The writer.</param> public virtual void Write(IOpenApiWriter writer) { if (writer == null) { throw Error.ArgumentNull("writer"); } // { for json, empty for YAML writer.WriteStartObject(); // schema writer.WriteOptionalObject(OpenApiConstants.OpenApiDocSchema, Schema); // example writer.WriteOptionalObject(OpenApiConstants.OpenApiDocExample, Example); // examples writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocExamples, Examples); // encoding writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocEncoding, Encoding); // specification extensions writer.WriteDictionary(Extensions); // } for json, empty for YAML writer.WriteEndObject(); }
private void WriteInternal(IOpenApiWriter writer) { Debug.Assert(writer != null); // { for json, empty for YAML writer.WriteStartObject(); // name writer.WriteRequiredProperty(OpenApiConstants.OpenApiDocName, Name); // in writer.WriteRequiredProperty(OpenApiConstants.OpenApiDocIn, In.ToString()); // description writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocDescription, Description); // required if (In == ParameterLocation.path) { writer.WriteRequiredProperty(OpenApiConstants.OpenApiDocRequired, true); } else { writer.WriteBooleanProperty(OpenApiConstants.OpenApiDocRequired, Required, false); } // deprecated writer.WriteBooleanProperty(OpenApiConstants.OpenApiDocDeprecated, Deprecated, false); // allowEmptyValue writer.WriteBooleanProperty(OpenApiConstants.OpenApiDocDeprecated, AllowEmptyValue, false); // style writer.WriteRequiredProperty(OpenApiConstants.OpenApiDocStyle, Style.ToString()); // explode writer.WriteBooleanProperty(OpenApiConstants.OpenApiDocExplode, Explode, false); // allowReserved writer.WriteBooleanProperty(OpenApiConstants.OpenApiDocAllowReserved, AllowReserved, false); // schema writer.WriteOptionalObject(OpenApiConstants.OpenApiDocSchema, Schema); // example writer.WriteOptionalObject(OpenApiConstants.OpenApiDocExample, Example); // examples writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocExamples, Examples); // content writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocContent, Content); // specification extensions writer.WriteDictionary(Extensions); // } for json, empty for YAML writer.WriteEndObject(); }
/// <summary> /// Write Any object to the given writer. /// </summary> /// <param name="writer">The writer.</param> public void Write(IOpenApiWriter writer) { if (writer == null) { throw Error.ArgumentNull("writer"); } // { for json, empty for YAML writer.WriteStartObject(); // authorizationUrl writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocAuthorizationUrl, AuthorizationUrl?.OriginalString); // tokenUrl writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocTokenUrl, TokenUrl?.OriginalString); // refreshUrl writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocRefreshUrl, RefreshUrl?.OriginalString); // scopes writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocScopes, Scopes); // specification extensions writer.WriteDictionary(Extensions); // } for json, empty for YAML writer.WriteEndObject(); }
private void WriteInternal(IOpenApiWriter writer) { // { for JSON, empty for YAML writer.WriteStartObject(); // operationRef writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocOperationRef, OperationRef); // operationId writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocOperationId, OperationId); // parameters writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocParameters, Parameters); // requestBody writer.WriteOptionalObject(OpenApiConstants.OpenApiDocRequestBody, RequestBody); // description writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocDescription, Description); // server writer.WriteOptionalObject(OpenApiConstants.OpenApiDocServer, Server); // specification extensions writer.WriteDictionary(Extensions); // } for JSON, empty for YAML writer.WriteEndObject(); }
/// <summary> /// Write Open API server object. /// </summary> /// <param name="writer">The Open API Writer.</param> public virtual void Write(IOpenApiWriter writer) { if (writer == null) { throw Error.ArgumentNull("writer"); } // { for JSON, empty for YAML writer.WriteStartObject(); // name writer.WriteRequiredProperty(OpenApiConstants.OpenApiDocUrl, Url.OriginalString); // description writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocDescription, Description); // variables writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocVariables, Variables); // specification extensions writer.WriteDictionary(Extensions); // } for JSON, empty for YAML writer.WriteEndObject(); }
/// <summary> /// Write Encoding object to the given writer. /// </summary> /// <param name="writer">The writer.</param> public void Write(IOpenApiWriter writer) { if (writer == null) { throw Error.ArgumentNull("writer"); } // { for json, empty for YAML writer.WriteStartObject(); // contentType writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocContentType, ContentType); // headers writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocHeaders, Headers); // style writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocStyle, Style?.ToString()); // explode writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocExplode, Explode); // allowReserved writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocAllowReserved, AllowReserved); // specification extensions writer.WriteDictionary(Extensions); // } for json, empty for YAML writer.WriteEndObject(); }
/// <summary> /// Write Open API operation object. /// </summary> /// <param name="writer">The Open API Writer.</param> public virtual void Write(IOpenApiWriter writer) { if (writer == null) { throw Error.ArgumentNull("writer"); } // { for json, empty for YAML writer.WriteStartObject(); // summary writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocSummary, Summary); // tags writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocTags, Tags); // description writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocDescription, Description); // externalDocs writer.WriteOptionalObject(OpenApiConstants.OpenApiDocExternalDocs, ExternalDocs); // operationId writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocOperationId, OperationId); // parameters writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocParameters, Parameters); // requestBody writer.WriteOptionalObject(OpenApiConstants.OpenApiDocRequestBody, RequestBody); // responses writer.WriteOptionalObject(OpenApiConstants.OpenApiDocResponses, Responses); // callbacks writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocCallbacks, Callbacks); // deprecated writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocDeprecated, Deprecated); // security writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocSecurity, Security); // servers writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocServers, Servers); // specification extensions writer.WriteDictionary(Extensions); // } for json, empty for YAML writer.WriteEndObject(); }
/// <summary> /// Write components object to the given writer. /// </summary> /// <param name="writer">The writer.</param> public virtual void Write(IOpenApiWriter writer) { if (writer == null) { throw Error.ArgumentNull("writer"); } // { for json, empty for YAML writer.WriteStartObject(); // schemas writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocSchemas, Schemas); // responses writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocResponses, Responses); // parameters writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocParameters, Parameters); // examples writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocExamples, Examples); // requestBodies writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocRequestBodies, RequestBodies); // headers writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocHeaders, Headers); // securitySchemes writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocSecuritySchemes, SecuritySchemes); // links writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocLinks, Links); // callbacks writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocCallbacks, Callbacks); // specification extensions writer.WriteDictionary(Extensions); // } for json, empty for YAML writer.WriteEndObject(); }
private void WriteInternal(IOpenApiWriter writer) { Debug.Assert(writer != null); // { for json, empty for YAML writer.WriteStartObject(); // type writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocType, Type); // title writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocTitle, Title); // multipleOf writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocMultipleOf, MultipleOf); // Pattern writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocPattern, Pattern); // MaxItems writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocMaxItems, MaxItems); // MinItems writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocMinItems, MinItems); // UniqueItems writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocUniqueItems, UniqueItems); // MaxProperties writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocMaxProperties, MaxProperties); // MinProperties writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocMinProperties, MinProperties); // Required writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocRequired, Required); // enum writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocEnum, Enum); // AllOf writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocAllOf, AllOf); // OneOf writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocOneOf, OneOf); // AnyOf writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocAnyOf, AnyOf); // Not writer.WriteOptionalCollection(OpenApiConstants.OpenApiDocNot, Not); // Items writer.WriteOptionalObject(OpenApiConstants.OpenApiDocItems, Items); // Properties writer.WriteOptionalDictionary(OpenApiConstants.OpenApiDocProperties, Properties); // AdditionalProperties writer.WriteOptionalObject(OpenApiConstants.OpenApiDocAdditionalProperties, AdditionalProperties); // Description writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocDescription, Description); // Format writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocFormat, Format); // Maximum writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocMaximum, Maximum); // exclusiveMaximum writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocExclusiveMaximum, ExclusiveMaximum); // Minimum writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocMinimum, Minimum); // exclusiveMinimum writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocExclusiveMinimum, ExclusiveMinimum); // MaxLength writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocMaxLength, MaxLength); // MaxLength writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocMinLength, MinLength); // Default writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocDefault, Default); // nullable writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocNullable, Nullable); // Discriminator writer.WriteOptionalObject(OpenApiConstants.OpenApiDocDiscriminator, Discriminator); // ReadOnly writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocReadOnly, ReadOnly); // WriteOnly writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocWriteOnly, WriteOnly); // XML writer.WriteOptionalObject(OpenApiConstants.OpenApiDocXml, Xml); // ExternalDocs writer.WriteOptionalObject(OpenApiConstants.OpenApiDocExternalDocs, ExternalDocs); // Example writer.WriteOptionalObject(OpenApiConstants.OpenApiDocExample, Example); // Deprecated writer.WriteOptionalProperty(OpenApiConstants.OpenApiDocDeprecated, Deprecated); // specification extensions writer.WriteDictionary(Extensions); // } for json, empty for YAML writer.WriteEndObject(); }