Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data_models/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import "./specs/data_models/Menstruation.tsp";
import "./specs/data_models/Athlete.tsp";
import "./specs/data_models/Body.tsp";
import "./specs/data_models/Events.tsp";
import "./specs/data_models/PlannedWorkouts.tsp";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's check if the file exists and understand the repository structure
echo "=== Repository structure ==="
ls -la data_models/

echo ""
echo "=== Main file content ==="
cat -n data_models/main.tsp

echo ""
echo "=== Checking PlannedWorkouts.tsp for `@service/`@server decorators ==="
if [ -f "data_models/specs/data_models/PlannedWorkouts.tsp" ]; then
  echo "--- PlannedWorkouts.tsp (first 30 lines) ---"
  head -30 "data_models/specs/data_models/PlannedWorkouts.tsp"
else
  echo "PlannedWorkouts.tsp not found"
fi

echo ""
echo "=== Checking decorators in imported files ==="
for f in enums common Samples TerraUser Activity Daily Sleep Nutrition Menstruation Athlete Body Events; do
  file="data_models/specs/data_models/${f}.tsp"
  if [ -f "$file" ]; then
    echo "--- $file ---"
    head -30 "$file" | grep -E "@(service|server|jsonSchema)" || echo "(no service/server/jsonSchema decorators in first 30 lines)"
  else
    echo "--- $file (NOT FOUND) ---"
  fi
done

Repository: tryterra/openapi

Length of output: 3968


🏁 Script executed:

#!/bin/bash
echo "=== tspconfig.yaml content ==="
cat -n tspconfig.yaml

echo ""
echo "=== package.json scripts ==="
cat package.json | grep -A 10 '"scripts"'

echo ""
echo "=== Check src directory structure ==="
ls -la src/ 2>/dev/null || echo "src/ not found"

echo ""
echo "=== Check specs directory structure ==="
find specs -type f -name "*.tsp" | head -20

Repository: tryterra/openapi

Length of output: 365


🏁 Script executed:

#!/bin/bash
echo "=== Current directory ==="
pwd

echo ""
echo "=== tspconfig.yaml content ==="
if [ -f "data_models/tspconfig.yaml" ]; then
  cat -n "data_models/tspconfig.yaml"
elif [ -f "tspconfig.yaml" ]; then
  cat -n tspconfig.yaml
fi

echo ""
echo "=== package.json scripts section ==="
if [ -f "data_models/package.json" ]; then
  cat "data_models/package.json" | jq '.scripts' 2>/dev/null || grep -A 5 '"scripts"' "data_models/package.json"
elif [ -f "package.json" ]; then
  cat package.json | jq '.scripts' 2>/dev/null || grep -A 5 '"scripts"' package.json
fi

echo ""
echo "=== Check if PlannedWorkouts appears in any config files ==="
find . -type f \( -name "*.json" -o -name "*.yaml" -o -name "*.yml" \) -exec grep -l "PlannedWorkouts" {} \; 2>/dev/null

Repository: tryterra/openapi

Length of output: 658


PlannedWorkouts.tsp uses OpenAPI/REST decorators but the build pipeline is not configured to emit OpenAPI output.

PlannedWorkouts.tsp imports @typespec/http, @typespec/rest, and @typespec/openapi3, and applies @service/@server decorators for OpenAPI generation. However, tspconfig.yaml is configured to emit only @typespec/json-schema output, not OpenAPI. The @service/@server decorators in PlannedWorkouts will not be processed or emitted by the build pipeline. Either add the OpenAPI emitter configuration to tspconfig.yaml or refactor PlannedWorkouts.tsp to use the JSON Schema paradigm consistent with other data models.

🤖 Prompt for AI Agents
In `@data_models/main.tsp` at line 14, PlannedWorkouts.tsp is using OpenAPI/REST
decorators (`@service/`@server and imports `@typespec/http`, `@typespec/rest`,
`@typespec/openapi3`) but the build only emits JSON Schema; either enable the
OpenAPI emitter in tspconfig.yaml or convert PlannedWorkouts.tsp to the
project's JSON Schema style. To fix: open tspconfig.yaml and add the OpenAPI
emitter configuration (enable `@typespec/openapi3` output) so the `@service/`@server
decorators in PlannedWorkouts.tsp are processed, or refactor the
PlannedWorkouts.tsp file to remove
`@typespec/http/`@typespec/rest/@typespec/openapi3 usage and model the API types
using the same JSON Schema-oriented patterns used by other data model files
(keeping type names and endpoints equivalent). Ensure references to
PlannedWorkouts.tsp, `@service`, `@server`, and tspconfig.yaml are updated
accordingly.


using JsonSchema;

Expand Down
Loading
Loading