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

Move JSON generation out of the middleware #30

Merged
merged 1 commit into from
Aug 13, 2020

Conversation

thestrabusiness
Copy link
Contributor

🧰 What's being changed?

This commit is a refactor that moves JSON generation out of the
middleware and in to two new classes Readme::Har and
Readme::Payload.

We added a new custom matcher for the JSON schema using the json-schema
gem
based on this blog post. We were unable to use an existing gem
that contained a similar RSpec matcher because it is built on top of the
json_schema gem (note the underscore rather than dash) that seems to
be having issues when expanding references to other local schema files.

🧪 Testing

This is a pure refactor. No new features were added. No manually testing is required. We added additional automated tests around the existing behavior.

Copy link

@joshuaclayton joshuaclayton left a comment

Choose a reason for hiding this comment

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

This looks great! 👍

This commit is a refactor that moves JSON generation out of the
middleware and in to two new classes `Readme::Har` and
`Readme::Payload`.

We added a new custom matcher for the JSON schema using the [json-schema
gem] based on [this blog post]. We were unable to use an [existing gem]
that contained a similar RSpec matcher because it is built on top of the
[json_schema gem] (note the underscore rather than dash) that seems to
be having issues when expanding references to other local schema files.

[this blog post]: https://github.com/thoughtbot/json_matchers
[json-schema gem]: https://github.com/ruby-json-schema/json-schema
[existing gem]: https://github.com/thoughtbot/json_matchers
[json_schema gem]: https://github.com/brandur/json_schema
@thestrabusiness thestrabusiness force-pushed the am-jq-move-json-generation branch from 70551b2 to 989900b Compare August 13, 2020 12:33
@thestrabusiness thestrabusiness merged commit 989900b into master Aug 13, 2020
@thestrabusiness thestrabusiness deleted the am-jq-move-json-generation branch August 13, 2020 12:33
djmango pushed a commit to djmango/metrics-sdks that referenced this pull request Sep 19, 2023
@erunion erunion added ruby Issues related to our Ruby SDK and removed area:ruby labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Issues related to our Ruby SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants