meshery / meshery/meshkit

Increase robustness of manifest handling in model generation.

Open
#926 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
223
Forks
225
Avg merge
7d 1h
Merged PRs (30d)
1

Description

> ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
>
> The current implementation of `getResolvedManifest` only clears `$ref` fields from schemas within `components/schemas`. While this is sufficient for the current usage in `GenerateFromOpenAPI`, the function is not fully generic. An OpenAPI document can have `$ref`s in other places like `paths`, `parameters`, `responses`, etc. To make this function more robust and reusable, consider extending it to clear `$ref`s from the entire document. For example, you could iterate through `doc.Paths` and other parts of `doc.Components` and call `clearSchemaRefs` on any `SchemaRef` found.

_Originally posted by @gemini-code-assist[bot] in [#924](https://github.com/meshery/meshkit/pull/924/changes#r2881678676)_

Contributor guide

Open the contributing guide

Research direction

Start at getResolvedManifest and clearSchemaRefs, then trace their use from GenerateFromOpenAPI. Inspect the OpenAPI document's Paths and Components structures to identify the SchemaRef values that need handling; done means references are cleared throughout the document without breaking current model generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, openapi
Domain
api, backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.