Redocly / Redocly/redocly-cli

Detect properties with no type defined

Open
#1,614 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
TypeScript
Stars
1.5k
Forks
228
Avg merge
1d 14h
Merged PRs (30d)
48

Description

Describe the solution you'd like

given a specification , it would like to ensure that all properties has a given type assidned (after resolution of $ref , and may be combination of allof etc)

to me most of the time if the properties is not defined is not on purpose but because it has been forgoten . I know that the schema is valid but still looks at least a warning would increase the API quality

Describe alternatives you've considered

create a dedicated rules could be an alternative

here name has no type and not detected as such

"Pet": {
                "type": "object",
                "required" : ["id", "name"],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name" : {
                        "description" : "this is the name of the pet"
                    }
            }
            

noType.json

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached noType.json example and inspect how the CLI handles $ref and allOf resolution before deciding whether this belongs in a dedicated rule. Completion should include detecting the untyped name property after resolution and emitting a warning while continuing to accept the schema as valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.