Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 3

create issue using oracle - Validation Failed

Solved! Go to Solution.

Hi, 

 

Do you known what I am doing wrong ?

 

Thank you,

 

Eric

declare
l_json_clob clob;
l_json_response varchar2(15000);
l_apex_user varchar2(50) := 'ericyuri';
l_apex_pw varchar2(50) := 'my_password';
l_api_create_issue varchar2(100) := 'https://api.github.com/repos/ericyuri/Oracle/issues';
begin
apex_web_service.g_request_headers(1).name := 'User-Agent';
apex_web_service.g_request_headers(1).Value := 'application/json';

l_json_clob := '{
"title": "Found a bug",
"body": "Im having a problem with this.",
"assignees": [
"octocat"
],
"milestone": 1,
"labels": [
"bug"
]
}';
l_json_response := apex_web_service.make_rest_request ( p_url => l_api_create_issue , p_http_method => 'POST' , p_username => l_apex_user , p_password => l_apex_pw , p_body => l_json_clob , p_wallet_path => null ); dbms_output.put_line(l_json_response); end;

 

result

{"message":"Validation Failed","errors":[{"value":1,"resource":"Issue","field":"milestone","code":"invalid"}],"documentation_url":"https://developer.github.com/v3/issues/#create-an-issue"}

Statement processed.

 

2 Replies
Solution
Community Manager
Message 2 of 3

Re: create issue using oracle - Validation Failed

It looks like you're trying to use the example from the documentation. The problem with the example is that if you don't have any milestones defined in the repository you're testing with, the creation of the issue will fail. If you take the line about the milestone out, it may work better.

 

I hope that helps!

Copilot Lvl 2
Message 3 of 3

Re: create issue using oracle - Validation Failed

Hi lee-dohmn,

 

Thank you for your awnser.

 

I just modified the l_json_clob to 

 

l_json_clob := '{
"title": "Found a bug",
"body": "Im having a problem with this.",
"labels": ["bug"]}';

 

and it worked !!

 

:D