chanjarster commented on a change in pull request #72: [SCB-1673] parse the
remaining information of RequestMapping
URL: https://github.com/apache/servicecomb-toolkit/pull/72#discussion_r361403220
##########
File path:
oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/context/OperationContext.java
##########
@@ -155,6 +165,58 @@ public Operation toOperation() {
return operation;
}
+ private void processHeaders() {
+
+ if (headers == null) {
+ headers = parentContext.getHeaders();
+ }
+
+ if (headers == null) {
+ return;
+ }
+
+ Arrays.stream(headers).forEach(header -> {
+ String[] headMap = header.split("=");
+ if (headMap.length == 2) {
+ HeaderParameter headerParameter = new HeaderParameter();
+ headerParameter.setName(headMap[0]);
+ StringSchema value = new StringSchema();
+ value.setDefault(headMap[1]);
+ headerParameter.setSchema(value);
+ operation.addParametersItem(headerParameter);
+ }
+ });
+ }
+
+ private void processProduces() {
+
+ if (produces == null) {
+ produces = parentContext.getProduces();
+ }
Review comment:
Provide `getProduces()` method just like `getHttpMethod()` will be better.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services