- com.smartbear.swagger.utils.OpenAPI3ExampleBuilder
-
public class OpenAPI3ExampleBuilder
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 io.swagger.v3.oas.annotations.media.ExampleObject
-
-
Methods Summary
Methods
Type Params |
Return Type |
Name and description |
|
public static Example |
alreadyProcessedRefExample(java.lang.String name, java.util.Map<java.lang.String, Schema<?>> definitions, ImmutableSet<java.lang.String> seenRefs, RequestType requestType, int depth)
|
|
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)
|
|
public static void |
mergeTo(ObjectExample output, java.util.List<Example> examples)
|
-
Inherited Methods Summary
Inherited Methods
Methods inherited from class |
Name |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
-
-
Field Detail
-
public static final int MAX_REFERENCE_DEPTH
-
public static final int SAMPLE_BASE_INTEGER_PROPERTY_VALUE
-
public static final boolean SAMPLE_BOOLEAN_PROPERTY_VALUE
-
public static final java.lang.String SAMPLE_DATETIME_PROPERTY_VALUE
-
public static final java.lang.String SAMPLE_DATE_PROPERTY_VALUE
-
public static final double SAMPLE_DECIMAL_PROPERTY_VALUE
-
public static final double SAMPLE_DOUBLE_PROPERTY_VALUE
-
public static final java.lang.String SAMPLE_EMAIL_PROPERTY_VALUE
-
public static final float SAMPLE_FLOAT_PROPERTY_VALUE
-
public static final int SAMPLE_INT_PROPERTY_VALUE
-
public static final int SAMPLE_LONG_PROPERTY_VALUE
-
public static final java.lang.String SAMPLE_STRING_PROPERTY_VALUE
-
public static final java.lang.String SAMPLE_UUID_PROPERTY_VALUE
-
Method Detail
-
public static Example alreadyProcessedRefExample(java.lang.String name, java.util.Map<java.lang.String, Schema<?>> definitions, ImmutableSet<java.lang.String> seenRefs, RequestType requestType, int depth)
-
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)
-
public static void mergeTo(ObjectExample output, java.util.List<Example> examples)
ReadyAPI functional (soapui) SDK 3.56.0