You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented this in my Azure environment. GET/DELETE work. PUT/PATCH do not. I keep getting: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)'
returned from the Log Stream when I input: curl -s -X PATCH https://{mysite}.azurewebsites.net/nordicid/6223F1E1-A9A0-403B-82C1-00BA031832D7 -d 'nordicpersonid={"PersonNameLast": "Abshireo"}'
I'm just trying to update the person last name.
flask==1.1.4 (was getting opencensus-ext-flask error with 2.0)
Table definition: CREATE TABLE [dbo].[NordicID]( [NordicPersonID] [uniqueidentifier] NOT NULL, [PersonNameLast] [varchar](50) NULL, [PersonNameFirst] [varchar](50) NULL, [OtherEntityType] [char](50) NULL, [OtherEntityName] [char](50) NULL, [OtherEntityID] [int] NOT NULL, [CreatedDate] [datetime] NOT NULL,
proc definition: CREATE OR ALTER PROCEDURE web.patch_NordicID @Json NVARCHAR(MAX) AS SET NOCOUNT ON; DECLARE @NordicID UNIQUEIDENTIFIER = JSON_VALUE(@Json, '$.NordicPersonID'); WITH [source] AS ( SELECT * FROM OPENJSON(@Json) WITH ( [NordicPersonID] UNIQUEIDENTIFIER, [PersonNameLast] VARCHAR(50), [PersonNameFirst] VARCHAR(50), [OtherEntityType] CHAR(50), [OtherEntityName] CHAR(50), [OtherEntityID] INT, [CreatedDate] DATETIME ) ) UPDATE t SET t.[PersonNameLast] = COALESCE(s.[PersonNameLast], t.[PersonNameLast]), t.[PersonNameFirst] = COALESCE(s.[PersonNameFirst], t.[PersonNameFirst]), t.[OtherEntityType] = COALESCE(s.[OtherEntityType], t.[OtherEntityType]), t.[OtherEntityName] = COALESCE(s.[OtherEntityName], t.[OtherEntityName]), t.[OtherEntityID] = COALESCE(s.[OtherEntityID], t.[OtherEntityID]), t.[CreatedDate] = COALESCE(s.[CreatedDate], t.[CreatedDate]) FROM [Wellward].[NordicID] t INNER JOIN [source] s ON t.[NordicPersonID] = s.[NordicPersonID] WHERE t.NordicPersonID = @NordicID; DECLARE @Json2 NVARCHAR(MAX) = N'{"NordicPersonID": "' + CAST(@NordicID AS NVARCHAR(255)) + N'"}' EXEC web.get_NordicID @Json2;
parser and patch def with my notes in application.py: parser.add_argument('nordicpersonid', type=str) def patch(self, nordic_id): # nordic_id = function parms args = parser.parse_args() nordic = json.loads(args['nordicpersonid']) nordic["NordicID"] = nordic_id # this builds the payload; 'NordicID' = tablename, nordic_id = parm result = self.executeQueryJson("patch", nordic) # procedure/verb, payload return result, 202
I have implemented this in my Azure environment. GET/DELETE work. PUT/PATCH do not. I keep getting:
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)'
returned from the Log Stream when I input:
curl -s -X PATCH https://{mysite}.azurewebsites.net/nordicid/6223F1E1-A9A0-403B-82C1-00BA031832D7 -d 'nordicpersonid={"PersonNameLast": "Abshireo"}'
I'm just trying to update the person last name.
flask==1.1.4 (was getting opencensus-ext-flask error with 2.0)
Table definition:
CREATE TABLE [dbo].[NordicID]( [NordicPersonID] [uniqueidentifier] NOT NULL, [PersonNameLast] [varchar](50) NULL, [PersonNameFirst] [varchar](50) NULL, [OtherEntityType] [char](50) NULL, [OtherEntityName] [char](50) NULL, [OtherEntityID] [int] NOT NULL, [CreatedDate] [datetime] NOT NULL,
proc definition:
CREATE OR ALTER PROCEDURE web.patch_NordicID @Json NVARCHAR(MAX) AS SET NOCOUNT ON; DECLARE @NordicID UNIQUEIDENTIFIER = JSON_VALUE(@Json, '$.NordicPersonID'); WITH [source] AS ( SELECT * FROM OPENJSON(@Json) WITH ( [NordicPersonID] UNIQUEIDENTIFIER, [PersonNameLast] VARCHAR(50), [PersonNameFirst] VARCHAR(50), [OtherEntityType] CHAR(50), [OtherEntityName] CHAR(50), [OtherEntityID] INT, [CreatedDate] DATETIME ) ) UPDATE t SET t.[PersonNameLast] = COALESCE(s.[PersonNameLast], t.[PersonNameLast]), t.[PersonNameFirst] = COALESCE(s.[PersonNameFirst], t.[PersonNameFirst]), t.[OtherEntityType] = COALESCE(s.[OtherEntityType], t.[OtherEntityType]), t.[OtherEntityName] = COALESCE(s.[OtherEntityName], t.[OtherEntityName]), t.[OtherEntityID] = COALESCE(s.[OtherEntityID], t.[OtherEntityID]), t.[CreatedDate] = COALESCE(s.[CreatedDate], t.[CreatedDate]) FROM [Wellward].[NordicID] t INNER JOIN [source] s ON t.[NordicPersonID] = s.[NordicPersonID] WHERE t.NordicPersonID = @NordicID; DECLARE @Json2 NVARCHAR(MAX) = N'{"NordicPersonID": "' + CAST(@NordicID AS NVARCHAR(255)) + N'"}' EXEC web.get_NordicID @Json2;
parser and patch def with my notes in application.py:
parser.add_argument('nordicpersonid', type=str) def patch(self, nordic_id): # nordic_id = function parms args = parser.parse_args() nordic = json.loads(args['nordicpersonid']) nordic["NordicID"] = nordic_id # this builds the payload; 'NordicID' = tablename, nordic_id = parm result = self.executeQueryJson("patch", nordic) # procedure/verb, payload return result, 202
routes:
api.add_resource(NordicID, '/nordicid', '/nordicid/<nordic_id>') # nordicid = procname suffix, nordic_id = parm
requirements.txt
application.txt
The text was updated successfully, but these errors were encountered: