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

[#446][Part3] Add OpenAPI to support creating API documentation with OpenAPI #466

Merged
merged 10 commits into from
Sep 29, 2023

Conversation

sanG-github
Copy link
Contributor

@sanG-github sanG-github commented Sep 7, 2023

close #446

What happened 👀

  • Added Dockerfile.mock
  • Added fly.toml
  • Added deploy_mock_server.yml

Insight 📝

Support mock_server add-on for the templates. This will help developers to deploy a mock server based on OpenAPI spec.

Here is the checklist of #446 when this pull request is merged:

  • Add OpenAPI addon as an mandatory addon in the template.
  • Add OpenAPI tooling (Spectral, Lint).
  • Create an endpoint (e.g., GET {{base_url}}/api/docs/openapi) to access the API documentation through the browser.
  • Add Mock Server with Prims (related to this API Mock Server with OpenAPI).
  • Add CI/CD workflow to run linting and deploy mock server to fly.io:
    • Linting
    • Deploy Mock Server

Proof Of Work 📹

Deployed successfully on local.
Screenshot 2023-09-07 at 16 13 05

@sanG-github sanG-github self-assigned this Sep 7, 2023
@sanG-github sanG-github changed the base branch from develop to feature/gh446-add-endpoint-for-openapi-docs September 7, 2023 10:02
@sanG-github sanG-github marked this pull request as ready for review September 7, 2023 10:03
Copy link
Contributor

@hoangmirs hoangmirs left a comment

Choose a reason for hiding this comment

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

As this PR belongs to the OpenAPI addon, should we move all template files into that folder instead? And find a way to integrate it with other add-ons (Docker, GitHub)?

@malparty malparty added this to the 5.9.0 milestone Sep 14, 2023
@malparty
Copy link
Member

After discussion with Sang, OpenAPI might NOT be an add-on, but a "mandatory" part of the template, included in any of the variants (API & Web). I'll wait until later this week to confirm that with Su V. If it's the case, I would argue that it will help keep the template code simpler and easier to test :D

@olivierobert
Copy link
Contributor

olivierobert commented Sep 19, 2023

@malparty @sanG-github It cannot be a compulsory add-on if no API is built. You can refer to the Gin templates:

https://github.com/nimblehq/gin-templates/blob/ad4b942bf841d834665d7198ecbba810eebfcd86/hooks/pre_gen_project.py#L36-L40

@malparty
Copy link
Member

All right, then let's implement it so that it does not leak in a new project that does not select the add-on 🙇

@sanG-github sanG-github force-pushed the feature/gh446-add-endpoint-for-openapi-docs branch from d9bb64a to 38a8e54 Compare September 21, 2023 08:02
@sanG-github sanG-github force-pushed the feature/gh446-add-mock-server branch 2 times, most recently from f4e635c to 487aeb9 Compare September 21, 2023 08:35
Copy link
Member

@suho suho left a comment

Choose a reason for hiding this comment

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

For a mock server, it should be an add-on (you can check gin-templates)

  • For API variant, we should show a message to ask if the developer want to have a mock server
  • For Web variant, if the developer add openapi add on, then we will ask to have a mock server

@sanG-github sanG-github marked this pull request as draft September 21, 2023 16:09
@sanG-github sanG-github marked this pull request as ready for review September 22, 2023 04:53
@sanG-github sanG-github requested a review from suho September 22, 2023 04:53
@sanG-github sanG-github force-pushed the feature/gh446-add-endpoint-for-openapi-docs branch from 53d9777 to c162277 Compare September 25, 2023 09:53
@sanG-github sanG-github force-pushed the feature/gh446-add-mock-server branch from afadbe6 to 98a64d9 Compare September 25, 2023 10:00
@sanG-github sanG-github force-pushed the feature/gh446-add-mock-server branch from 0b6e3bc to a026cb2 Compare September 25, 2023 10:18
Makefile Outdated Show resolved Hide resolved
@sanG-github sanG-github force-pushed the feature/gh446-add-endpoint-for-openapi-docs branch from c162277 to e527a20 Compare September 26, 2023 04:11
@sanG-github sanG-github force-pushed the feature/gh446-add-mock-server branch from a026cb2 to f423d95 Compare September 26, 2023 04:13
Makefile Show resolved Hide resolved
@sanG-github sanG-github force-pushed the feature/gh446-add-endpoint-for-openapi-docs branch from e527a20 to 98d42ae Compare September 28, 2023 01:01
@sanG-github sanG-github force-pushed the feature/gh446-add-mock-server branch from fa830b4 to d20d1ae Compare September 28, 2023 01:04
Base automatically changed from feature/gh446-add-endpoint-for-openapi-docs to develop September 29, 2023 02:08
@malparty
Copy link
Member

@sanG-github last rebase needed :harold:

@sanG-github sanG-github force-pushed the feature/gh446-add-mock-server branch from 7a73e42 to 1688599 Compare September 29, 2023 04:36
@malparty malparty added this pull request to the merge queue Sep 29, 2023
Merged via the queue into develop with commit 2affbce Sep 29, 2023
@malparty malparty deleted the feature/gh446-add-mock-server branch September 29, 2023 07:33
@malparty malparty mentioned this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add OpenAPI to support creating API documentation with OpenAPI
5 participants