CAICAIIs commented on code in PR #3280:
URL: https://github.com/apache/dubbo-go/pull/3280#discussion_r3052707621


##########
global/openapi_config.go:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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 global
+
+type OpenAPIConfig struct {
+       Enabled bool `yaml:"enabled" json:"enabled" default:"false"`
+
+       Path string `yaml:"path" json:"path,omitempty"`
+
+       InfoTitle       string `yaml:"info-title" json:"infoTitle,omitempty"`
+       InfoDescription string `yaml:"info-description" 
json:"infoDescription,omitempty"`
+       InfoVersion     string `yaml:"info-version" 
json:"infoVersion,omitempty"`
+
+       DefaultConsumesMediaTypes []string `yaml:"default-consumes-media-types" 
json:"defaultConsumesMediaTypes,omitempty"`
+       DefaultProducesMediaTypes []string `yaml:"default-produces-media-types" 
json:"defaultProducesMediaTypes,omitempty"`
+       DefaultHttpStatusCodes    []string `yaml:"default-http-status-codes" 
json:"defaultHttpStatusCodes,omitempty"`
+
+       Settings map[string]string `yaml:"settings" json:"settings,omitempty"`
+}
+
+func DefaultOpenAPIConfig() *OpenAPIConfig {

Review Comment:
   I checked the generated spec with the default config and just a single 
registered service.
   
   Using `global.DefaultOpenAPIConfig()` (with `Enabled = true`), generating 
the document, and then running:
   
   `npx --yes @redocly/cli lint <generated-spec>.json --extends=spec`
   
   reports:
   
   `The field 'title' must be present on this level.`
   
   The generated output contains `"info": { "version": "1.0.0" }` but no 
`info.title`, so this is not an edge case from merging or special 
configuration; it already happens in the default path.
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to