Skip to content

Commit 9093329

Browse files
committed
docs
1 parent f6a9824 commit 9093329

4 files changed

Lines changed: 33 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ tr.warnings; // list of warning messages, if any
2222
<dependency>
2323
<groupId>com.webfuzzing</groupId>
2424
<artifactId>overlay-jvm</artifactId>
25-
<version>LATEST</version>
25+
<version>0.1.0</version>
2626
</dependency>
2727
```
2828

29-
See release info for latest version number (to replace `LATEST` placeholder).
30-
3129
## Dependencies
3230

3331
This library has 2 main dependencies:

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
1) update release_notes.md before preparing a new release
156156
157157
2) manually update <version> in thi file. Typically just remove the -SNAPSHOT tag.
158+
Update the same version number in the README.md.
158159
Git commit/push.
159160
160161
3) run:

src/main/java/com/webfuzzing/overlayjvm/Processor.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ public static Overlay parseOverlay(String overlayContent){
4040
}
4141

4242

43+
/**
44+
* Apply an Overlay set of transformations to an OpenAPI schema.
45+
* These file representations are passed as String, representing either JSON or YAML formats.
46+
* The transformed result format depends on the input OpenAPI format.
47+
* For example, if OpenAPI is in YAML, and Overlay is in JSON, the transformed result is in YAML.
48+
* <p>
49+
* There is no validity check on the input OpenAPI schema, besides it being a syntactically valid
50+
* JSON or YAML file representation.
51+
* So, technically speaking, the Overlay transformation can be applied to any valid JSON/YAML file.
52+
*
53+
* @param openApiSchema String representation for a JSON/YAML file, in which transformations are applied on.
54+
* @param overlayContent String representation for a JSON/YAML Overlay set of transformations.
55+
* @return TransformationResult with the result of the transformation, including possible warning messages, if any.
56+
* @throws IllegalArgumentException if the inputs are not valid JSON/YAML files, and if the Overlay is not correct
57+
* according the Overlay's specs. No validation is done on the OpenAPI specs.
58+
*/
4359
public static TransformationResult applyOverlay(String openApiSchema, String overlayContent){
4460

4561
List<String> warnings = new ArrayList<>();

src/main/java/com/webfuzzing/overlayjvm/TransformationResult.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,24 @@
55

66
public class TransformationResult {
77

8+
/**
9+
* The original OpenAPI schema the transformation was applied on.
10+
*/
811
public final String originalSchema;
12+
/**
13+
* The original Overlay applied to the input OpenAPI schema.
14+
*/
915
public final String appliedOverlay;
16+
/**
17+
* The result of the transformation, i.e., when appliedOverlay is applied to the originalSchema.
18+
*/
1019
public final String transformedSchema;
20+
/**
21+
* Possible warning messages when applying the transformations.
22+
* For example, actions with RFC 9535 json paths that result in no node selection are marked as warning,
23+
* although technically they are non-erroneous (according to the Overlay specs).
24+
* This can be useful when debugging json paths, instead of silently ignoring actions that led to no modifications.
25+
*/
1126
public final List<String> warnings;
1227

1328
public TransformationResult(String originalSchema, String appliedOverlay, String transformedSchema, List<String> warnings) {

0 commit comments

Comments
 (0)