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

feat: Add implementation for generating mock event from openapi schema #40

Merged
merged 4 commits into from
Sep 13, 2023

Conversation

hnnasit
Copy link
Contributor

@hnnasit hnnasit commented Sep 12, 2023

Issue number:
N/A

Summary

This PR adds implementation for loading OpenAPI schema using the go lib https://pkg.go.dev/github.com/getkin/kin-openapi/openapi3 and generating a skeleton mock event.

Changes

New file structure:

internal
│   └── pkg
│       ├── mock
│       │   └── event
│       │       ├── openapi.go
│       │       ├── openapi_test.go
│       │       ├── schemas.go
│       │       ├── schemas_test.go

openapi.go: contains a function to load the fetched schema and call a recursive function which generates the skeleton of the mock event
schemas.go: Contains the existing func to fetch schema from schema registry.

Please provide a summary of what's being changed

User experience

Please share what the user experience looks like before and after this change

Mandatory Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@hnnasit hnnasit marked this pull request as ready for review September 12, 2023 17:19
@hnnasit hnnasit requested a review from a team as a code owner September 12, 2023 17:19
Copy link
Contributor

@jysheng123 jysheng123 left a comment

Choose a reason for hiding this comment

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

Looks good to me

internal/pkg/mock/event/openapi.go Outdated Show resolved Hide resolved
internal/pkg/mock/event/openapi.go Show resolved Hide resolved
@hnnasit hnnasit added this pull request to the merge queue Sep 13, 2023
Merged via the queue into develop with commit 7a0344e Sep 13, 2023
17 checks passed
@jfuss jfuss deleted the generate-openapi-event branch October 31, 2023 19:31
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.

3 participants