Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONPath for YAML Samples #47

Merged
merged 1 commit into from
Nov 1, 2024
Merged

JSONPath for YAML Samples #47

merged 1 commit into from
Nov 1, 2024

Conversation

rambleraptor
Copy link
Member

This adds support for a JSONPath-like syntax for YAML samples. (Doesn't support arrays). You can do something like '$.paths./publishers.get' to get the portion of the YAML sample.

Relates to aep-dev/aeps#234

Copy link
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

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

nice, thanks! symbolic approval primarily, but LGTM.

return yaml.dump(result);
}

function sampleProto(code: string, token1: string, token2: string) {
Copy link
Member

Choose a reason for hiding this comment

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

proto code looks pretty hairy.... I wonder if there is some sort of protobuf parser we can rely on at some point?

the syntax is much, much more complex than OpenAPI though.

Copy link
Member Author

Choose a reason for hiding this comment

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

We aren't actually doing any protobuf parsing. The syntax we've chosen revolves around looking at indentation levels.

I really dislike this, so I'll take a look at it.

@rambleraptor rambleraptor merged commit c8b95e1 into main Nov 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants