(schemaName string)
| 156 | } |
| 157 | |
| 158 | func (s *Server) formatSchemaDetail(schemaName string) string { |
| 159 | props, ok := s.openAPIIndex.GetSchema(schemaName) |
| 160 | if !ok { |
| 161 | return fmt.Sprintf("Unknown schema: %s\n\nUse search_api(operationId=\"...\") to see schemas in request/response bodies.", schemaName) |
| 162 | } |
| 163 | |
| 164 | var sb strings.Builder |
| 165 | |
| 166 | // Normalize name for display |
| 167 | displayName := schemaName |
| 168 | if !strings.HasPrefix(schemaName, "bytebase.v1.") { |
| 169 | displayName = "bytebase.v1." + schemaName |
| 170 | } |
| 171 | |
| 172 | fmt.Fprintf(&sb, "## %s\n\n", displayName) |
| 173 | |
| 174 | // Check if it's an enum |
| 175 | if len(props) == 1 && props[0].Name == "enum" { |
| 176 | sb.WriteString("**Enum values:** ") |
| 177 | sb.WriteString(props[0].Description) |
| 178 | sb.WriteString("\n") |
| 179 | return sb.String() |
| 180 | } |
| 181 | |
| 182 | for _, prop := range props { |
| 183 | s.formatProperty(&sb, prop) |
| 184 | } |
| 185 | |
| 186 | return sb.String() |
| 187 | } |
| 188 | |
| 189 | func (*Server) formatProperty(sb *strings.Builder, prop PropertyInfo) { |
| 190 | required := "" |
no test coverage detected