I can successfully create "general" merge request notes using following API:
POST /projects/:id/merge_requests/:merge_request_iid/notes
However, when trying to add a position object to the POST request, it will be ignored. For my experiments, I've tried to use exactly the same position object as it's reported when querying merge request information:
type: "DiffNote"
body: "+6x1"
position:
base_sha: "b1f8788c186e0120ccae93797cd280fa28a0ef3c"
start_sha: "b1f8788c186e0120ccae93797cd280fa28a0ef3c"
head_sha: "27ce170fcd248f980679f8ffd104c9b600141db1"
old_path: "file1.txt"
new_path: "file1.txt"
position_type: "text"
old_line: null
new_line: 5
Related
request body form-data
I tried the following but didnot work
pm.request.body.data
pm.request.data
Access this format
pm.request.body.formdata.get("name")
pm.request.body.formdata.get("last_name")
pm.request.body.formdata.get("other_name")
Documentation in here
formdata :PropertyList.<FormParam>
Form data parameters for this request are held in this field.
Type:
PropertyList.<FormParam>
Usage in Tests tab.
I have the following endpoints configured for managing types of food
POST ~ /food/types
GET ~ /food/types
GET ~ /food/types/{id}
PUT ~ /food/types/{id}
Delete ~ /food/types/{id}
I'm trying to represent a clone operation in my REST API and wanted to avoid the use of Verbs in my endpoints.
After some research I've come up with the following as it conforms the most out of other solutions i could think of to basic REST principles:
POST ~ /food/types?sourceId={id}
This would mean that the method for this endpoint (in a typical MVC framework) would need to conditionally handle both the creation when a JSON payload is sent, and the duplication of a resource when a query parameter is provided.
I'm trying to think how i can express that in my OpenAPI specification document (v3.0.2)
Here is what i've got so far:
/api/food/types:
post:
summary: Create a new type of food
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: ./response/food-type.yaml
'400':
description: Bad Request
requestBody:
content:
application/json:
schema:
$ref: ./request/food-type.yaml
description: Create a new type of food
tags:
- Food Type
parameters: []
The request/food-type.yaml contains an object with two required parameters:
Name,
Category
When my framework validates the request against the OpenAPI specification, i want it to sometimes ignore the request body if and only if, a request parameter has been provided with a 'sourceId' parameter.
Is this type of thing even possible to express in OpenAPI 3+, or am i going about this the wrong way?
Simply put, is it possible to ignore the request body when a specific query parameter has been provided in a post request using OpenAPI 3.
And following that question, is my approach to REST lacking, and is there a better way i could represent the cloning of a resource in my API?
Use the body of the message instead to describe the source:
POST /food/types {"clone": "{id}"}
You can even use verb if you convert them into nouns:
POST /food/type-cloning {"source": "{id}"}
When I upsert a row that mismatches schema I get a PartialFailureError along with a message, e.g.:
[ { errors:
[ { message: 'Repeated record added outside of an array.',
reason: 'invalid' } ],
...
]
However for large rows this isn't sufficient, because I have no idea which field is the one creating the error. The bq command does report the malformed field.
Is there either a way to configure or access name of the offending field, or can this be added to the API endpoint?
Please see this Github Issue: https://github.com/googleapis/nodejs-bigquery/issues/70 . Apparently node.js client library is not getting the location field from the API so it's not able to return it to the caller.
Workaround that worked for me: I copied the JSON payload to my Postman client and manually sent a request to REST API (let me know if you need more details of how to do it).
I would like to extract raw report results within the CloudConnect process.
So far I have managed to get response from the raw report API end point - https://secure.gooddata.com/gdc/app/projects/{project_id}/execute/raw/
This response contains URI to the file and if I put that URI to browser, file is uploaded.
I have tried passing this URI to the following readers without success:
CSV Reader produces the following error:
------------------- Error details ------------------
Component [CSV Reader:CSV_READER] finished with status ERROR.
Parsing error: Unexpected end of file in record 1, field 1 ("date"),
metadata "outOfStock";
value: Raw record data is not available, please turn on verbose mode.
File Download - I don't know how to pass the URI through the port to "URL to Downlaod" parameter.
HTTP Connector again I don't see how to pass URI from the port.
What is the way to do this?
EDIT
If I use the HTTP Connector as suggested by #Filip, I get the following error:
Error details:
Component [HTTP connector:HTTP_CONNECTOR] finished with status ERROR. hostname in
certificate didn't match: xxx.com != secure.gooddata.com OR secure.gooddata.com
I have tried setting header to X-GDC-CHECK-DOMAIN: false with no effect.
The HTTP connector is the right component to go with. Leave the URL property empty and use the component’s property called “Input mapping”, where in the graphic editor you can assign the input edge field to the URL field.
Solution from GoodData support:
HTTP connector can be also used, but it is very complex, because
logging in to GoodData has to be created. REST connector has it built
in.
If you want to run the example graph, you have to be logged in in
CloudConnect with a user who has access to the project from where you
would like to export the report. You also have to change URL to
the one of white-labeled account in both REST connector components and change project
and report definition in the first REST connector.
So the graph that works looks like this:
Here are the main fields that you will need to set for each element:
Get Results URI - set params for POST request:
Request URL = https://secure.gooddata.com/gdc/app/projects/${GDC_PROJECT_ID}/execute/raw/
Request Body =
{
"report_req": {
"reportDefinition": "gdc/md/${GDC_PROJECT_ID}/obj/${OBJECT_ID}"
}
}
Get URI from Response - just map uri value to corresponding field:
<Mapping cloverField="uri" xpath="uri"/>
Load Results - make sure it is connected to metadata with two fields, one for response with data, other to pass through the uri.
Load Results - you will need to exclude uri field to process the data:
Exclude Fields = uri
I am using docusign_rest gem. I am creating template with
create_template
method and envelope with
create_envelope_from_template
method.
But when I was trying to retrieving the url for embedded signing with the help of following code
client = DocusignRest::Client.new
#url = client.get_recipient_view(
envelope_id: #envelope_response["envelopeId"],
name: 'some_name',
email: 'some_email',
return_url: 'http://google.com'
)
then it returning nil. So I am unable to generate url.
When I am using the iodocs portal of docusign for the same POST request
Recipient v2/accounts/:accountId/envelopes/:envelopeId/views/recipient
{
"authenticationMethod": "email",
"email": "some_email",
"returnUrl": "www.gmail.com",
"userName": "some_name",
"clientUserId": "some_email"
}
I get the url as required.
So am I doing something incorrect in the ruby gem's call or is there a bug?
user2593706 : this will return nil because u r not passing any value #envelope_response["envelopeId"] so u need to pass the envelope id which is created previously or any other u want to get response. in rails its very easy to implement... if u want to look at response from docusign u need to use your terminal for that.. do this...
1. rails c
2. paste your create_template method code as yours
3. paste your create_envelope_from_template code
4. then run immediately your code
client = DocusignRest::Client.new
#url = client.get_recipient_view(
envelope_id: #envelope_response["envelopeId"],
name: 'some_name',
email: 'some_email',
return_url: 'http://google.com'
)
then u will get ur response.... hope this works. and its really good to do this task
To use embedding functionality for a given envelope, you need to set the clientUserId property at the time the envelope is being created, then you reference it again with the same value when requesting the URL (just like you have in your code).
This page from the DocuSign Dev Center explains it in more detail:
http://www.docusign.com/developer-center/explore/features/embedding-docusign