private ArrayNode generate() {
        final ArrayNode definitions = mapper.createArrayNode();

        final Set<ObjectNode> methodDefinitions =
                serviceInfos.stream()
                            .flatMap(serviceInfo -> serviceInfo.methods().stream().map(this::generate))
                            .collect(toImmutableSet());

        return definitions.addAll(methodDefinitions);
    }
Generate an array of json schema specifications for each method inside the service.

@param serviceSpecification the service specification to generate the json schema from.

@return ArrayNode that contains service specifications
core/src/main/java/com/linecorp/armeria/server/docs/JsonSchemaGenerator.java