Skip to content

Expose JsonPointer for each IOpenApiElement #2673

@Fresa

Description

@Fresa

It would be nice to be able to back trace to a context in the original OpenAPI document.

Example: Get a pointer to the original parameter spec which can be used by a code generator given the original document.

Example:

OpenApiDocument document = ...;
var pointer = document.Paths.First().Value.Parameters.First().JsonPointer;
Console.WriteLine(pointer);
// #/paths/~1pets/get/parameters/0

Describe the solution you'd like
Expose a JsonPointer in IOpenApiElement.

Describe alternatives you've considered
I'm not aware of any alternatives, except serializing an element, which might differ from the original json node, and doesn't include a pointer to the original document.

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions