[
https://issues.apache.org/jira/browse/SCB-684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16520086#comment-16520086
]
ASF GitHub Bot commented on SCB-684:
------------------------------------
wujimin commented on a change in pull request #773: [SCB-684]Following swagger
conventions. Adding and change some test cases.
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/773#discussion_r197363425
##########
File path:
demo/demo-springmvc/springmvc-server/src/main/java/org/apache/servicecomb/demo/springmvc/server/ProducerSchemaFactoryHolder.java
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.demo.springmvc.server;
+
+import org.apache.servicecomb.core.BootListener;
+import org.apache.servicecomb.core.definition.SchemaMeta;
+import org.apache.servicecomb.core.definition.schema.ProducerSchemaFactory;
+import org.apache.servicecomb.demo.TestMgr;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectWriter;
+import com.google.common.base.Charsets;
+import com.google.common.hash.Hashing;
+
+import io.swagger.models.Swagger;
+import io.swagger.util.Yaml;
+
+/**
+ * Created by Administrator on 2018/6/22.
+ */
+public class ProducerSchemaFactoryHolder implements BootListener {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(ProducerSchemaFactoryHolder.class);
+
+ private ObjectWriter writer = Yaml.pretty();
+
+ @Autowired
+ private ProducerSchemaFactory factory;
+
+ public void test() {
+ LOGGER.info("ProducerSchemaFactoryHolder testing start");
+ SchemaMeta meta =
+ factory.getOrCreateProducerSchema("customer-service",
+ "test1",
+ CodeFirstSpringmvcForSchema.class,
+ new CodeFirstSpringmvcForSchema());
+ String codeFirst = getSwaggerContent(meta.getSwagger());
+
TestMgr.check("07a48acef4cc1a7f2387d695923c49e98951a974e4f51cf1356d6878db48888f",
+ Hashing.sha256().newHasher().putString(codeFirst,
Charsets.UTF_8).hash().toString());
Review comment:
org.apache.servicecomb.serviceregistry.RegistryUtils.calcSchemaSummary(String)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Following swagger conventions
> -----------------------------
>
> Key: SCB-684
> URL: https://issues.apache.org/jira/browse/SCB-684
> Project: Apache ServiceComb
> Issue Type: Improvement
> Components: Java-Chassis
> Reporter: liubao
> Assignee: liubao
> Priority: Major
>
> Check with swagger validator, some warnings and errors are given:
>
>
> Errors Hide Semantic error at paths./add.post Operations with Parameters of
> "in: formData" must include "application/x-www-form-urlencoded" or
> "multipart/form-data" in their "consumes" property Jump to line 13 Semantic
> error at paths./add.post Operations with Parameters of "in: formData" must
> include "application/x-www-form-urlencoded" or "multipart/form-data" in their
> "consumes" property Jump to line 13 Schema error at
> paths['/reduce'].get.parameters[0] should NOT have additional properties
> additionalProperty: type, format, name, in, required Jump to line 36 Schema
> error at paths['/reduce'].get.parameters[0].required should be equal to one
> of the allowed values allowedValues: true Jump to line 36 Schema error at
> paths['/reduce'].get.paramete
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)