- com.smartbear.swagger.utils.example.OpenAPI3ExampleBuilder
-
public class OpenAPI3ExampleBuilder
extends java.lang.Object
Build an Example JSON from a Swagger 3 Schema}. The implementation is
similar to ExampleBuilder, but there are some key differences in the way references
are expanded:
- A reference is expanded and an example is built for the referenced schema if its depth
within the example hierarchy is less than OpenAPI3ExampleBuilder.MAX_REFERENCE_DEPTH
- A reference is not expanded if points to on object of the same type as any of its parent objects. This
prevents polluting the object hierarchy when child objects contain references back to their parent objects.
References that are not expanded are replaced with an empty ExampleObject
-
-
Methods Summary
Methods
| Type Params |
Return Type |
Name and description |
|
public static Example |
fromProperty(java.lang.String name, Schema property, java.util.Map<java.lang.String, Schema<?>> definitions, RequestType requestType)
|
|
public static Example |
fromProperty(java.lang.String name, Schema property, java.util.Map<java.lang.String, Schema<?>> definitions, ImmutableSet<java.lang.String> seenRefs, RequestType requestType, int depth)
|
|
public static Example |
fromSchema(Schema property, java.util.Map<java.lang.String, Schema<?>> definitions, RequestType requestType)
|
-
Inherited Methods Summary
Inherited Methods
| Methods inherited from class |
Name |
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
-
-
Field Detail
-
public static final int MAX_REFERENCE_DEPTH
-
Method Detail
-
public static Example fromProperty(java.lang.String name, Schema property, java.util.Map<java.lang.String, Schema<?>> definitions, RequestType requestType)
-
public static Example fromProperty(java.lang.String name, Schema property, java.util.Map<java.lang.String, Schema<?>> definitions, ImmutableSet<java.lang.String> seenRefs, RequestType requestType, int depth)
-
public static Example fromSchema(Schema property, java.util.Map<java.lang.String, Schema<?>> definitions, RequestType requestType)
ReadyAPI functional (soapui) SDK 3.65.0