code: JsonObjectBuilder build(final TypeIdentifier identifier) {
          final SwaggerType type = toSwaggerType(identifier.getType());
          switch (type) {
              case BOOLEAN:
              case INTEGER:
              case NUMBER:
              case NULL:
              case STRING:
                  final JsonObjectBuilder builder = Json.createObjectBuilder();
                  addPrimitive(builder, type);
                  return builder;
          }
  
          final JsonObjectBuilder builder = Json.createObjectBuilder();
  
          final TypeRepresentationVisitor visitor = new TypeRepresentationVisitor() {
  
              private boolean inCollection = false;
  
              @Override
              public void visit(final TypeRepresentation.ConcreteTypeRepresentation representation) {
                  final JsonObjectBuilder nestedBuilder = inCollection ? Json.createObjectBuilder() : builder;
                  add(nestedBuilder, representation);
  
                  if (inCollection) {
                      builder.add("items", nestedBuilder.build());
                  }
              }
  
              @Override
              public void visitStart(final TypeRepresentation.CollectionTypeRepresentation representation) {
                  builder.add("type", "array");
                  inCollection = true;
              }
  
              @Override
              public void visitEnd(final TypeRepresentation.CollectionTypeRepresentation representation) {
                  builder.add("type", "array");
                  inCollection = true;
              }
  
              @Override
              public void visit(final TypeRepresentation.EnumTypeRepresentation representation) {
                  builder.add("type", "string");
                  if (!representation.getEnumValues().isEmpty()) {
                      final JsonArrayBuilder array = representation.getEnumValues().stream().sorted().collect(Json::createArrayBuilder, JsonArrayBuilder::add, JsonArrayBuilder::add);
                      if (inCollection) {
                          builder.add("items", Json.createObjectBuilder().add("type", "string").add("enum", array).build());
                      } else {
                          builder.add("enum", array);
                      }
  
                  }
              }
  
          };
  
          final TypeRepresentation representation = typeRepresentations.get(identifier);
          if (representation == null)
              builder.add("type", "object");
          else
              representation.accept(visitor);
          return builder;
      }
docs: Creates the schema object builder for the identifier.
  The actual definitions are retrieved via {@link SchemaBuilder#getDefinitions} after all types have been declared.
  
  @param identifier The identifier
  @return The schema JSON object builder with the needed properties