swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/processor/annotation/ApiResponsesMethodProcessor.java [47:77]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      if (StringUtils.isEmpty(apiResponse.responseCode()) || "default".equals(apiResponse.responseCode())) {
        throw new IllegalArgumentException("@ApiResponse status code must be defined.");
      }
      Class<?> type = null;
      for (Content content : apiResponse.content()) {
        if (StringUtils.isNotEmpty(content.mediaType())) {
          produces.add(content.mediaType());
        }
        if (content.schema() != null && content.schema().implementation() != Void.class) {
          type = content.schema().implementation();
        }
      }
      operationGenerator.getOperationGeneratorContext().updateResponse(apiResponse.responseCode(),
          type == null ? null : SwaggerUtils.resolveTypeSchemas(swaggerGenerator.getOpenAPI(), type));
      if (StringUtils.isNotEmpty(apiResponse.description())) {
        operationGenerator.getOperationGeneratorContext().updateResponseDescription(apiResponse.responseCode(),
            apiResponse.description());
      }
      for (Header header : apiResponse.headers()) {
        if (header.schema() == null || header.schema().implementation() == Void.class) {
          throw new IllegalArgumentException("@ApiResponse header schema implementation must be defined.");
        }
        if (StringUtils.isEmpty(header.name())) {
          throw new IllegalArgumentException("@ApiResponse header name must be defined.");
        }
        operationGenerator.getOperationGeneratorContext().updateResponseHeader(apiResponse.responseCode(),
            header.name(), AnnotationUtils.schemaModel(swaggerGenerator.getOpenAPI(), header.schema()));
      }
    }
    if (!CollectionUtils.isEmpty(produces)) {
      operationGenerator.getOperationGeneratorContext().updateProduces(produces);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/processor/annotation/OperationMethodAnnotationProcessor.java [55:85]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if (StringUtils.isEmpty(apiResponse.responseCode()) || "default".equals(apiResponse.responseCode())) {
          throw new IllegalArgumentException("@ApiResponse status code must be defined.");
        }
        Class<?> type = null;
        for (Content content : apiResponse.content()) {
          if (StringUtils.isNotEmpty(content.mediaType())) {
            produces.add(content.mediaType());
          }
          if (content.schema() != null && content.schema().implementation() != Void.class) {
            type = content.schema().implementation();
          }
        }
        operationGenerator.getOperationGeneratorContext().updateResponse(apiResponse.responseCode(),
            type == null ? null : SwaggerUtils.resolveTypeSchemas(swaggerGenerator.getOpenAPI(), type));
        if (StringUtils.isNotEmpty(apiResponse.description())) {
          operationGenerator.getOperationGeneratorContext().updateResponseDescription(apiResponse.responseCode(),
              apiResponse.description());
        }
        for (Header header : apiResponse.headers()) {
          if (header.schema() == null || header.schema().implementation() == Void.class) {
            throw new IllegalArgumentException("@ApiResponse header schema implementation must be defined.");
          }
          if (StringUtils.isEmpty(header.name())) {
            throw new IllegalArgumentException("@ApiResponse header name must be defined.");
          }
          operationGenerator.getOperationGeneratorContext().updateResponseHeader(apiResponse.responseCode(),
              header.name(), AnnotationUtils.schemaModel(swaggerGenerator.getOpenAPI(), header.schema()));
        }
      }
      if (!CollectionUtils.isEmpty(produces)) {
        operationGenerator.getOperationGeneratorContext().updateProduces(produces);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



