Contributions
Re: Validate JSON Payload in SwaggerHub
because there is no build in function to validate JSON Payload in Swaggerhub, so i created a JSON Payload validation method running in Azure Function that converts SwaggerHub OpenAPI spec to Json schema specification (2020-12), use newtonsoft to validate the Json Data Payload used in the SwaggerHub API. Example: string schema = ConvertToJsonSchema(OpenApiJson) JSchema jsonSchema = JSchema.Parse(schema); JObject jsonData = JObject.Parse(jsonPayload); IList<string> errors = new List<string>(); bool valid = jsonData.IsValid(jsonSchema, out errors);950Views0likes0Comments