Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated: Issue/1175/improve open api final 2 #1224

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d94c673
fix(#1175): OpenAPI connector enhancements for simulator random messa…
Jun 11, 2024
f453c35
fix(#1175): OpenAPI connector enhancements for simulator random messa…
Jun 11, 2024
e911e28
feat(#1175): Add OpenApiRepository and Validation
Jun 21, 2024
99f4484
chore(#1175): minor adjustments on imports and code style
bbortt Jun 24, 2024
01f3620
feat(#1175): Add OpenApiRepository and Validation
Jun 25, 2024
634ce32
feat(#1175): improve random data generation for test data generator
Jul 5, 2024
519471b
feat(#1175): added random generator framework
Jul 7, 2024
f0b1801
feat(#1156): provide test api generator
May 13, 2024
2ace5e3
chore: remove author annotations
May 21, 2024
a95a3f2
chore: add license to new files
May 21, 2024
e7b52a3
chore: cleanup generator tests
Jun 5, 2024
06905bf
chore: improve OpenApi example
Jun 5, 2024
092f8d4
ci: connect openapi generator to maven reactor
bbortt Jul 2, 2024
c77cb07
feat(#1156): generate Java models alongside citrus classes
bbortt Jul 3, 2024
28226f6
new api generation
Jul 21, 2024
fb37b1b
feat(#1175): adds open api validation by standard citrus schema valid…
Jul 21, 2024
df20671
feat: improve open api generator
Sep 29, 2024
c7d90fe
fix: pom structure
bbortt Oct 15, 2024
9347c94
chore(citrus-openapi): review and code cleanup
bbortt Oct 21, 2024
827aa46
chore(citrus-api): review and code cleanup
bbortt Oct 23, 2024
d05a76a
chore(citrus-base): review and code cleanup
bbortt Oct 24, 2024
04ef7cf
chore(citrus-spring): review and code cleanup
bbortt Oct 24, 2024
93eb149
chore(citrus-http): review and code cleanup
bbortt Oct 24, 2024
539d894
chore(citrus-jms): review and code cleanup
bbortt Oct 24, 2024
93bb411
chore(citrus-rmi): review and code cleanup
bbortt Oct 24, 2024
1aeee3e
docs(#1175): review
bbortt Oct 24, 2024
e5b17ad
chore(citrus-test-api-core): review and code cleanup
bbortt Oct 26, 2024
8952a65
chore(citrus-test-api-generator-core): review and code cleanup
bbortt Oct 28, 2024
24cf7c9
chore(citrus-test-api-generator-maven-plugin): review and code cleanup
bbortt Oct 28, 2024
68ebcb3
chore(citrus-test-api-spring): review and code cleanup
bbortt Oct 28, 2024
34b067e
chore(citrus-validation): review and code cleanup
bbortt Oct 28, 2024
db3f1c5
ci: fix citrus java codegen test with root folder
bbortt Oct 28, 2024
c4262d5
feat: changes on open api feature due to first beta tests
Nov 22, 2024
948fc48
chore: bump maven reactor to 4.5.0-SNAPSHOT
bbortt Nov 24, 2024
6c5b9c2
feat: changes on open api feature due to first beta tests
Nov 25, 2024
6252e9d
feat: changes on open api feature due to first beta tests
Dec 5, 2024
cedca03
feat: add option to specify OpenApiValidationPolicy
Dec 11, 2024
0a263e7
chore: fix test errors
Dec 12, 2024
78d7ee7
fix: accept only json and plain text for random message generation
Dec 13, 2024
36bef5b
fix: adjust paths for code generation according to CodeGenMojo
Jan 8, 2025
1812ab6
chore: bump all versions to 4.6.0-SNAPSHOT
bbortt Jan 9, 2025
adef764
fix: treat unparsable server urls as non existent
Jan 9, 2025
119f3b1
fix(api): add logger message to OpenApiSchemaValidation for httpMessa…
Jan 15, 2025
44933c7
fix(api): rename the message variable to httpMessage because a type c…
Jan 15, 2025
dc44aba
fix(api): redo the formatting as it was
Jan 15, 2025
2a8ca5d
fix: add draft open api documentation
Jan 24, 2025
5a036af
fix: finalize documentation of open api
Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions catalog/citrus-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,21 @@
<artifactId>citrus-openapi</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-test-api-core</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-test-api-generator-core</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-test-api-spring</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-jms</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,23 @@
import org.citrusframework.jbang.UnitTestSupport;
import org.citrusframework.spi.Resource;
import org.citrusframework.spi.Resources;
import org.citrusframework.util.TestUtils;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class JBangActionTest extends UnitTestSupport {

private final Resource helloScript = Resources.fromClasspath("org/citrusframework/jbang/hello.java");

@BeforeClass
public static void beforeEach() {
if (!TestUtils.isNetworkReachable()) {
throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible.");
}
}

@Test
public void testScriptOrFile() {
JBangAction jbang = new JBangAction.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@
import org.citrusframework.TestCase;
import org.citrusframework.TestCaseMetaInfo;
import org.citrusframework.jbang.actions.JBangAction;
import org.citrusframework.util.TestUtils;
import org.citrusframework.xml.XmlTestLoader;
import org.citrusframework.xml.actions.XmlTestActionBuilder;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class JBangTest extends AbstractXmlActionTest {

@BeforeClass
public static void beforeEach() {
if (!TestUtils.isNetworkReachable()) {
throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible.");
}
}

@Test
public void shouldLoadJBangActions() {
XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/jbang/xml/jbang-test.xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@
import org.citrusframework.TestCase;
import org.citrusframework.TestCaseMetaInfo;
import org.citrusframework.jbang.actions.JBangAction;
import org.citrusframework.util.TestUtils;
import org.citrusframework.yaml.YamlTestLoader;
import org.citrusframework.yaml.actions.YamlTestActionBuilder;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class JBangTest extends AbstractYamlActionTest {

@BeforeClass
public static void beforeEach() {
if (!TestUtils.isNetworkReachable()) {
throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible.");
}
}

@Test
public void shouldLoadJBangActions() {
YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/jbang/yaml/jbang-test.yaml");
Expand Down
10 changes: 9 additions & 1 deletion connectors/citrus-openapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-data-models</artifactId>
</dependency>
<dependency>
<groupId>com.atlassian.oai</groupId>
<artifactId>swagger-request-validator-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.17.0</version>
</dependency>

<!-- Test scoped dependencies -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.citrusframework.openapi;

/**
* Enum representing different types of auto-fill behavior for OpenAPI parameters/body.
* This enum defines how missing or required parameters/body should be auto-filled.
*/
public enum AutoFillType {
/**
* No auto-fill will be performed for any parameters/body.
*/
NONE,

/**
* Auto-fill will be applied only to required parameters/body that are missing.
*/
REQUIRED,

/**
* Auto-fill will be applied to all parameters/body, whether they are required or not.
*/
ALL
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.citrusframework.openapi;

public final class OpenApiConstants {

public static final String TYPE_ARRAY = "array";
public static final String TYPE_BOOLEAN = "boolean";
public static final String TYPE_INTEGER = "integer";
public static final String TYPE_NUMBER = "number";
public static final String TYPE_OBJECT = "object";
public static final String TYPE_STRING = "string";

public static final String FORMAT_INT32 = "int32";
public static final String FORMAT_INT64 = "int64";
public static final String FORMAT_FLOAT = "float";
public static final String FORMAT_DOUBLE = "double";
public static final String FORMAT_DATE = "date";
public static final String FORMAT_DATE_TIME = "date-time";
public static final String FORMAT_UUID = "uuid";

/**
* Prevent instantiation.
*/
private OpenApiConstants() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.citrusframework.openapi;

import org.citrusframework.message.MessageHeaders;

public class OpenApiMessageHeaders {

public static final String OAS_PREFIX = MessageHeaders.PREFIX + "oas_";

public static final String OAS_UNIQUE_OPERATION_ID = OAS_PREFIX + "unique_operation_id";

public static final String OAS_SPECIFICATION_ID = OAS_PREFIX + "unique_specification_id";

public static final String OAS_MESSAGE_TYPE = OAS_PREFIX + "message_type";

public static final String RESPONSE_TYPE = OAS_PREFIX + "response";

public static final String REQUEST_TYPE = OAS_PREFIX + "request";

private OpenApiMessageHeaders() {
// Static access only
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.citrusframework.openapi;

/**
* The {@code OpenApiMessageType} enum defines the types of OpenAPI messages,
* specifically REQUEST and RESPONSE. Each type is associated with a specific
* header name, which is used to identify the type of message in the OpenAPI
* message headers.
*/
public enum OpenApiMessageType {

REQUEST(OpenApiMessageHeaders.REQUEST_TYPE), RESPONSE(OpenApiMessageHeaders.RESPONSE_TYPE);

private final String headerName;

OpenApiMessageType(String headerName) {
this.headerName = headerName;
}

public String toHeaderName() {
return headerName;
}
}
Loading
Loading