Lasagna-Love-Portal / bechamel-api

Bechamel: a REST API for Lasagna Love request, requester and volunteer management
Eclipse Public License 2.0
5 stars 4 forks source link

Update API: change from camelCase to snake_case naming #10

Closed mattkuznicki-ll closed 1 year ago

mattkuznicki-ll commented 1 year ago

This changes API schema naming and field naming from the mix of camelCase and PascalCase previously proposed, to consistent snake_case naming. Initial sketch code updated with updated field names from API proposal. The initial sketch code maintains PascalCase usage for field names in the data models as Golang requires struct fields to begin with a capital letter in order for the JSON package to see and export these.

As part of this, additional de-capitalization of certain words in comments and field names was performed.

patmejia commented 1 year ago

quick baseline test sequence:

Initiated a POST request to the /login route:

curl -X POST -H "Content-Type: application/json" -d '{"userName":"TestUser1","password":"Password1"}' http://localhost:8080/login

Validates the authentication mechanism for an existing user via the /login endpoint. Expected outcome: JWT:

Screenshot 2023-05-25 at 1 28 36 AM

✔︎ pass

Dispatched a GET request to the /profile route:

curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlYXQiOjE2ODQ5OTQyNjAsImlhdCI6MTY4NDk5MzY2MCwibmJmIjoxNjg0OTkzNjYwLCJ1c2VyTmFtZSI6IlRetc3RVc2VyMSJ9.kJGqkLZLUd3xsX7m_BxeTegXr5rU6cqTl6sS2GM_6nI" http://localhost:8080/profile

Tests the GET request mechanism when targeting the /profile route. Expected outcome: a JSON formatted user profile data:

Screenshot 2023-05-25 at 1 29 16 AM

✔︎ pass

Roadmap:

🤝 consistent naming conventions needed in the codebase for improved maintainability

✅ Initial tests passed; comprehensive testing needed.

💍 proposing sandbox testing with tools like Playwright or similar