-
Notifications
You must be signed in to change notification settings - Fork 18
Replace Postman collection with .rest file
#494
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 0 additions & 161 deletions
161
postman_collections/python-samples-fastapi-restful.postman_collection.json
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| ### RESTful API with Python 3 and FastAPI | ||
| ### https://github.com/nanotaboada/python-samples-fastapi-restful | ||
| ### | ||
| ### Requires the REST Client extension for VS Code: | ||
| ### https://marketplace.visualstudio.com/items?itemName=humao.rest-client | ||
| ### | ||
| ### Key design note: | ||
| ### squad_number = natural key (domain-meaningful, preferred for lookups) | ||
| ### id (UUID) = surrogate key (internal, opaque, used for CRUD operations) | ||
|
|
||
| @baseUrl = http://localhost:9000 | ||
|
|
||
| # ------------------------------------------------------------------------------ | ||
| # Health | ||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| ### GET /health/ — liveness check | ||
| GET {{baseUrl}}/health/ | ||
| Accept: application/json | ||
|
|
||
| # ------------------------------------------------------------------------------ | ||
| # POST /players/ — Create | ||
| # Thiago Almada (squad 16): not seeded in the database, used as the creation | ||
| # fixture. No id in the body; the server generates a UUID v4 on creation. | ||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| ### POST /players/ — Create a new Player | ||
| POST {{baseUrl}}/players/ | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "firstName": "Thiago", | ||
| "middleName": "Ezequiel", | ||
| "lastName": "Almada", | ||
| "dateOfBirth": "2001-04-26T00:00:00.000Z", | ||
| "squadNumber": 16, | ||
| "position": "Attacking Midfield", | ||
| "abbrPosition": "AM", | ||
| "team": "Atlanta United FC", | ||
| "league": "Major League Soccer", | ||
| "starting11": false | ||
| } | ||
|
|
||
| # ------------------------------------------------------------------------------ | ||
| # GET /players/ — Retrieve all | ||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| ### GET /players/ — Retrieve all Players | ||
| GET {{baseUrl}}/players/ | ||
| Accept: application/json | ||
|
|
||
| # ------------------------------------------------------------------------------ | ||
| # GET /players/{player_id} — Retrieve by UUID (surrogate key, internal) | ||
| # Emiliano Martínez (squad 23): UUID v5, seeded by seed_001. | ||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| ### GET /players/{player_id} — Retrieve a Player by UUID | ||
| GET {{baseUrl}}/players/b04965e6-a9bb-591f-8f8a-1adcb2c8dc39 | ||
| Accept: application/json | ||
|
|
||
| # ------------------------------------------------------------------------------ | ||
| # GET /players/squadnumber/{squad_number} — Retrieve by Squad Number (natural key, domain) | ||
| # Preferred lookup for external consumers. | ||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| ### GET /players/squadnumber/{squad_number} — Retrieve a Player by Squad Number | ||
| GET {{baseUrl}}/players/squadnumber/10 | ||
| Accept: application/json | ||
|
|
||
| # ------------------------------------------------------------------------------ | ||
| # PUT /players/{player_id} — Update | ||
| # Emiliano Martínez (squad 23): UUID v5, seeded by seed_001. | ||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| ### PUT /players/{player_id} — Update an existing Player | ||
| PUT {{baseUrl}}/players/b04965e6-a9bb-591f-8f8a-1adcb2c8dc39 | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "firstName": "Emiliano", | ||
| "middleName": null, | ||
| "lastName": "Martínez", | ||
| "dateOfBirth": "1992-09-02T00:00:00.000Z", | ||
| "squadNumber": 23, | ||
| "position": "Goalkeeper", | ||
| "abbrPosition": "GK", | ||
| "team": "Aston Villa FC", | ||
| "league": "Premier League", | ||
| "starting11": true | ||
| } | ||
|
|
||
| # ------------------------------------------------------------------------------ | ||
| # DELETE /players/{player_id} — Delete | ||
| # Thiago Almada (squad 16): created by POST above. Since the UUID is generated | ||
| # at runtime, retrieve it first via squad number, then substitute it below. | ||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| ### Step 1 — Look up Almada's UUID by squad number | ||
| GET {{baseUrl}}/players/squadnumber/16 | ||
| Accept: application/json | ||
|
|
||
| ### Step 2 — Delete Almada using the UUID returned above | ||
| # Replace {player_id} with the id field from the response above. | ||
| DELETE {{baseUrl}}/players/{player_id} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.