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

Case insensitive keys in request body #28

Open
gopherus opened this issue Jun 9, 2023 · 1 comment
Open

Case insensitive keys in request body #28

gopherus opened this issue Jun 9, 2023 · 1 comment
Assignees

Comments

@gopherus
Copy link
Collaborator

gopherus commented Jun 9, 2023

Request:
PATCH /v1/api/dev/actor HTTP/1.1
Host: 127.0.0.1:8080
Content-Type: application/json

Both request body values are equivalent:

{
  "Entity": [
    {
      "ActorId":0,
      "FirstName": "Mike",
      "LastName": "Wazowski",
      "LastUpdate": "2023-01-01T00:00:00Z"
    }
  ]
}
{
  "entity": [
    {
      "actorId":0,
      "firstName": "Mike",
      "lastName": "Wazowski",
      "lastUpdate": "2023-01-01T00:00:00Z"
    }
  ]
}
@gopherus
Copy link
Collaborator Author

gopherus commented Jun 9, 2023

type Actor struct {
	ActorId    int       `sqlx:"name=actor_id,autoincrement,primaryKey,required"`
	FirstName  string    `sqlx:"name=first_name,required"`
	LastName   string    `sqlx:"name=last_name,unique,table=actor,required"`
	LastUpdate time.Time `sqlx:"name=last_update,required"`
	Has        *ActorHas `setMarker:"true" typeName:"ActorHas" json:"-"  sqlx:"-" `
}

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

No branches or pull requests

2 participants