using System.Collections.Generic; using Microsoft.OpenApi.Models; using Models; namespace Parser { public static class EndpointParser { public static List ParseAllEndpoints(OpenApiDocument openApiDocument) { List endpoints = new List(); foreach (var path in openApiDocument.Paths) { endpoints.Add(ParseEndpoint(path)); } return endpoints; } static Endpoint ParseEndpoint(KeyValuePair path) { Endpoint endpoint = new Endpoint(path.Key); foreach (KeyValuePair operation in path.Value.Operations) { endpoint.Requests.Add(RequestParser.ParseRequest(operation)); } return endpoint; } } }