Skip to content

Commit

Permalink
Format comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cromoteca committed Sep 22, 2023
1 parent 86a34be commit 4a120e4
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public void enter(NodePath<?> nodePath) {

@Override
public void exit(NodePath<?> nodePath) {
// deal with the union nodes, which does not correspond to an existing class, but express the union of all the @JsonSubTypes
// deal with the union nodes, which does not correspond to an existing
// class, but express the union of all the @JsonSubTypes
if (nodePath.getNode() instanceof UnionNode) {
var unionNode = (UnionNode) nodePath.getNode();
var cls = (Class<?>) unionNode.getSource().get();
Expand All @@ -65,7 +66,8 @@ public void exit(NodePath<?> nodePath) {
(OpenAPI) nodePath.getParentPath().getNode().getTarget());
}

// entity nodes whose superclass has a @JsonSubTypes annotation must have a @type property whose value comes from the annotation
// entity nodes whose superclass has a @JsonSubTypes annotation must
// have a @type property whose value comes from the annotation
if (nodePath.getNode() instanceof EntityNode) {
var entityNode = (EntityNode) nodePath.getNode();
var cls = (Class<?>) entityNode.getSource().get();
Expand Down Expand Up @@ -112,7 +114,8 @@ public NodeDependencies scan(@Nonnull NodeDependencies nodeDependencies) {
return nodeDependencies;
}

// all types mentioned in @JsonSubTypes must be parsed, even if they are not used directly
// all types mentioned in @JsonSubTypes must be parsed, even if they are
// not used directly
Class<?> refClass = (Class<?>) ref.getClassInfo().get();
var subTypes = getJsonSubTypes(refClass).map(JsonSubTypes.Type::value)
.map(ClassInfoModel::of).<Node<?, ?>> map(EntityNode::of);
Expand All @@ -134,7 +137,8 @@ private static Stream<JsonSubTypes.Type> getJsonSubTypes(Class<?> cls) {
}

/**
* A node that represents the union of all the mentioned subclasses of a class annotated with {@code @JsonSubTypes}.
* A node that represents the union of all the mentioned subclasses of a
* class annotated with {@code @JsonSubTypes}.
*/
public static class UnionNode
extends AbstractNode<ClassInfoModel, Schema<?>> {
Expand Down

0 comments on commit 4a120e4

Please sign in to comment.