예제 #1
0
 private static OpenApiSchema ErrorCodeMinorFieldSchema()
 {
     return(new OpenApiSchema
     {
         Description = "This is the container for a single code minor status code.",
         Properties = new ConcurrentDictionary <string, OpenApiSchema>
         {
             ["name"] = SchemaFactory.Schema("string"),
             ["value"] = new OpenApiSchema
             {
                 Type = "string",
                 Enum = new List <IOpenApiAny>
                 {
                     Api.String("fullsuccess"),
                     Api.String("invalid_sort_field"),
                     Api.String("invalid_selection_field"),
                     Api.String("forbidden"),
                     Api.String("unauthorisedrequest"),
                     Api.String("internal_server_error"),
                     Api.String("unknownobject"),
                     Api.String("server_busy"),
                     Api.String("invaliduuid"),
                 }
             },
         },
         Required = new HashSet <string>
         {
             "name",
             "value"
         }
     });
 }
예제 #2
0
 public static OpenApiParameter QueryParameter(string name, string type, string format, string description, bool depreciated = false)
 {
     return(new OpenApiParameter
     {
         Name = name,
         Description = description,
         Deprecated = depreciated,
         In = ParameterLocation.Query,
         AllowEmptyValue = false,
         AllowReserved = false,
         Schema = SchemaFactory.Schema(type, format)
     });
 }
예제 #3
0
 private static OpenApiSchema ErrorCodeMinorSchema()
 {
     return(new OpenApiSchema
     {
         Description = "This is the container for the set of code minor status codes reported in the responses from the Service Provider.",
         Properties = new ConcurrentDictionary <string, OpenApiSchema>
         {
             ["codes"] = SchemaFactory.ArraySchema("ErrorCodeMinorField")
         },
         Required = new HashSet <string>
         {
             "codes",
         }
     });
 }
예제 #4
0
 private static OpenApiSchema ErrorStatusInfoSchema()
 {
     return(new OpenApiSchema
     {
         Type = "object",
         Description = "This is the container for the status code and associated information returned within the HTTP messages received from the Service Provider. For the CASE service this object will only be returned to provide information about a failed request i.e. it will NOT be in the payload for a successful request. See Appendix B for further information on the interpretation of the information contained within this class.",
         Properties = new ConcurrentDictionary <string, OpenApiSchema>
         {
             ["codeMajor"] = new OpenApiSchema
             {
                 Type = "string",
                 Enum = new List <IOpenApiAny>
                 {
                     Api.String("success"),
                     Api.String("processing"),
                     Api.String("failure"),
                     Api.String("unsupported")
                 }
             },
             ["severity"] = new OpenApiSchema
             {
                 Type = "string",
                 Enum = new List <IOpenApiAny>
                 {
                     Api.String("status"),
                     Api.String("warning"),
                     Api.String("error")
                 }
             },
             ["description"] = SchemaFactory.Schema("string"),
             ["codeMinor"] = Api.SchemaReference(
                 string.Format(ApiStrings.SchemaReferencePathFormat, "ErrorCodeMinor"))
         },
         Required = new HashSet <string>
         {
             "codeMajor",
             "severity"
         }
     });
 }
예제 #5
0
 public static OpenApiComponents Components()
 {
     return(new OpenApiComponents
     {
         Schemas = new ConcurrentDictionary <string, OpenApiSchema>
         {
             //["DataSets"] = new OpenApiSchema
             //{
             //    Type = "object",
             //    Description = ApiStrings.DataSetsSchemaDescription,
             //    Properties = new ConcurrentDictionary<string, OpenApiSchema>
             //    {
             //        ["total"] = new OpenApiSchema
             //        {
             //            Type = "integer"
             //        },
             //        ["sets"] = new OpenApiSchema
             //        {
             //            Type = "array",
             //            Items = SchemaReference(
             //                string.Format(ApiStrings.SchemaReferencePathFormat, "DataSet"))
             //        }
             //    }
             //},
             //["DataSet"] = new OpenApiSchema
             //{
             //    Type = "object",
             //    Description = ApiStrings.DataSetSchemaDescription,
             //    Properties = new ConcurrentDictionary<string, OpenApiSchema>
             //    {
             //        ["id"] = SchemaReference(
             //            string.Format(ApiStrings.SchemaReferencePathFormat, "UUID")),
             //        ["name"] = new OpenApiSchema
             //        {
             //            Type = "string"
             //        },
             //        ["description"] = new OpenApiSchema
             //        {
             //            Type = "string"
             //        },
             //        ["category"] = new OpenApiSchema
             //        {
             //            Type = "string"
             //        },
             //        ["attribution"] = new OpenApiSchema
             //        {
             //            Type = "string"
             //        },
             //        ["attributionLink"] = SchemaReference(
             //            string.Format(ApiStrings.SchemaReferencePathFormat, "URL")),
             //        ["iconLink"] = SchemaReference(
             //            string.Format(ApiStrings.SchemaReferencePathFormat, "URL"))
             //    }
             //},
             ["URL"] = new OpenApiSchema
             {
                 Description = "The data-type for establishing a Uniform Resource Locator (URL) as defined by W3C.",
                 Type = "string",
                 Format = "uri"
             },
             ["UUID"] = new OpenApiSchema
             {
                 Description = "The data-type for establishing a Globally Unique Identifier (GUID). The form of the GUID is a Universally Unique Identifier (UUID) of 16 hexadecimal characters (lower case) in the format 8-4-4-4-12. All permitted versions (1-5) and variants (1-2) are supported.",
                 Type = "string",
                 Format = "uuid"
             },
             ["ErrorStatusInfo"] = new OpenApiSchema
             {
                 Type = "object",
                 Description = "This is the container for the status code and associated information returned within the HTTP messages received from the Service Provider. For the CASE service this object will only be returned to provide information about a failed request i.e. it will NOT be in the payload for a successful request. See Appendix B for further information on the interpretation of the information contained within this class.",
                 Properties = new ConcurrentDictionary <string, OpenApiSchema>
                 {
                     ["codeMajor"] = new OpenApiSchema
                     {
                         Type = "string",
                         Enum = new List <IOpenApiAny>
                         {
                             new OpenApiString("success"),
                             new OpenApiString("processing"),
                             new OpenApiString("failure"),
                             new OpenApiString("unsupported")
                         }
                     },
                     ["severity"] = new OpenApiSchema
                     {
                         Type = "string",
                         Enum = new List <IOpenApiAny>
                         {
                             new OpenApiString("status"),
                             new OpenApiString("warning"),
                             new OpenApiString("error")
                         }
                     },
                     ["description"] = SchemaFactory.Schema("string"),
                     ["codeMinor"] = SchemaReference(
                         string.Format(ApiStrings.SchemaReferencePathFormat, "ErrorCodeMinor"))
                 },
                 Required = new HashSet <string>
                 {
                     "codeMajor",
                     "severity"
                 }
             },
             ["ErrorCodeMinor"] = new OpenApiSchema
             {
                 Description = "This is the container for the set of code minor status codes reported in the responses from the Service Provider.",
                 Properties = new ConcurrentDictionary <string, OpenApiSchema>
                 {
                     ["codes"] = SchemaFactory.ArraySchema("ErrorCodeMinorField")
                 },
                 Required = new HashSet <string>
                 {
                     "codes",
                 }
             },
             ["ErrorCodeMinorField"] = new OpenApiSchema
             {
                 Description = "This is the container for a single code minor status code.",
                 Properties = new ConcurrentDictionary <string, OpenApiSchema>
                 {
                     ["name"] = SchemaFactory.Schema("string"),
                     ["value"] = new OpenApiSchema
                     {
                         Type = "string",
                         Enum = new List <IOpenApiAny>
                         {
                             new OpenApiString("fullsuccess"),
                             new OpenApiString("invalid_sort_field"),
                             new OpenApiString("invalid_selection_field"),
                             new OpenApiString("forbidden"),
                             new OpenApiString("unauthorisedrequest"),
                             new OpenApiString("internal_server_error"),
                             new OpenApiString("unknownobject"),
                             new OpenApiString("server_busy"),
                             new OpenApiString("invaliduuid"),
                         }
                     },
                 },
                 Required = new HashSet <string>
                 {
                     "name",
                     "value"
                 }
             },
         }
     });
 }