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

implement json-patch for entity. #70

Merged
merged 6 commits into from
Nov 26, 2021
Merged

Conversation

gdlxSong
Copy link
Contributor

steps

  1. create an entity.
curl -X PUT "http://localhost:3500/v1.0/invoke/core/method/v1/plugins/abcd/entities/test123" \
  -H "Source: abcd" \
  -H "Owner: admin" \
  -H "Type: DEVICE" \
  -H "Content-Type: application/json" \
  -d '{
       "person": {
         "age": 22
       }
     }'
  1. patch persion.age
curl -X PATCH "http://localhost:6789/v1/plugins/abcd/entities/test123" \
  -H "Source: abcd" \
  -H "Owner: admin" \
  -H "Type: DEVICE" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "path": "person.age",
      "operator": "replace",
      "value": 20
    }
  ]'
  1. query entity
curl -X GET "http://localhost:3500/v1.0/invoke/core/method/v1/plugins/abcd/entities/test123" \
  -H "Source: abcd" \
  -H "Owner: admin"  \
  -H "Type: DEVICE"

@gdlxSong gdlxSong merged commit d286a5d into tkeel-io:main Nov 26, 2021
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.

1 participant