Search in sources :

Example 41 with Path

use of com.reprezen.kaizen.oasparser.model3.Path in project ets-ogcapi-features10 by opengeospatial.

the class OpenApiUtils method isFreeFormParameterSupportedForCollection.

public static boolean isFreeFormParameterSupportedForCollection(OpenApi3 apiModel, URI iut, String collectionName) {
    String requestedPath = createCollectionPath(apiModel, iut, collectionName);
    List<Path> paths = identifyTestPoints(apiModel, requestedPath, new PathMatcher());
    for (Path path : paths) {
        Collection<Parameter> parameters = path.getGet().getParameters();
        for (Parameter parameter : parameters) {
            if (parameter.getSchema() != null && parameter.getSchema().isAdditionalProperties()) {
                return true;
            }
        }
    }
    return false;
}
Also used : Path(com.reprezen.kaizen.oasparser.model3.Path) Parameter(com.reprezen.kaizen.oasparser.model3.Parameter)

Example 42 with Path

use of com.reprezen.kaizen.oasparser.model3.Path in project ets-ogcapi-features10 by opengeospatial.

the class OpenApiUtilsTest method testRelativeServerPath.

@Test
public void testRelativeServerPath() throws Exception {
    OpenApi3Parser parser = new OpenApi3Parser();
    URL openApiDocument = OpenApiUtilsTest.class.getResource("openapi-relativeServerPath.json");
    OpenApi3 apiModel = parser.parse(openApiDocument, true);
    List<TestPoint> testPoints = retrieveTestPoints(apiModel, iut);
    assertThat(testPoints.size(), is(2));
    assertThat(testPoints.get(0).getServerUrl(), is("http://localhost:8080/path"));
    assertThat(testPoints.get(1).getServerUrl(), is("http://localhost:8080/path"));
}
Also used : OpenApi3Parser(com.reprezen.kaizen.oasparser.OpenApi3Parser) URL(java.net.URL) OpenApi3(com.reprezen.kaizen.oasparser.model3.OpenApi3) Test(org.junit.Test)

Aggregations

Path (com.reprezen.kaizen.oasparser.model3.Path)24 Parameter (com.reprezen.kaizen.oasparser.model3.Parameter)21 Operation (com.reprezen.kaizen.oasparser.model3.Operation)16 ArrayList (java.util.ArrayList)8 Path (org.dishevelled.bio.assembly.gfa1.Path)7 Schema (com.reprezen.kaizen.oasparser.model3.Schema)6 BufferedReader (java.io.BufferedReader)5 OpenApi3 (com.reprezen.kaizen.oasparser.model3.OpenApi3)4 PrintWriter (java.io.PrintWriter)4 HashMap (java.util.HashMap)4 CommandLineParseException (org.dishevelled.commandline.CommandLineParseException)4 OpenApi3Parser (com.reprezen.kaizen.oasparser.OpenApi3Parser)3 LinkedList (java.util.LinkedList)3 Traversal (org.dishevelled.bio.assembly.gfa1.Traversal)3 Test (org.testng.annotations.Test)3 HashBasedTable (com.google.common.collect.HashBasedTable)2 Table (com.google.common.collect.Table)2 ApduConnectionException (es.gob.jmulticard.apdu.connection.ApduConnectionException)2 Asn1Exception (es.gob.jmulticard.asn1.Asn1Exception)2 TlvException (es.gob.jmulticard.asn1.TlvException)2