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

fix #257 Adding option to set the obj id from a non JSON response #263

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

S3B4SZ17
Copy link

Summary

Addressing the #257 issue. If an API response with a non JSON formatted obj (a string or int i.e 1234 or my-string) we are going to use that value as the tf obj id. We need to set the id_attribute option as *.

Example

Example non-JSON response from the fakeserver:

curl 127.0.0.1:8080/api/objects -X POST -d '{ "Id": "1", "Name": "Foo", "No_json": true}'
1

That 1 will be used as the Obj ID

Tests

Under restapi/api_object_test.go created the create_object_no_json_response test case

S3B4SZ17 added 3 commits March 9, 2024 21:06
… we can identify we are not getting a formatted JSON response object

If we get a response as a string or int we are assigning that response
as the id of the obj. We need to set the `id_attribute` to `*`
* Adding a Makefile for simplicity to build the project and clean it, also
to run the tests more easily
* Updated the fakeserver so we can test the new func for non JSON
  responses
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