changeset API

Isak Jonsson's Avatar

Isak Jonsson

24 Nov, 2011 09:02 AM

Hi, I am trying out the changeset API, but I don't understand the YAML part. Is there a YAML schema so I can validate my body? I fail to submit changesets copied from the documentation, see below.

Cheers,

/Isak

$ cat c.xml
<changeset>
  <body></body>
  <body-html></body-html>
  <changed-at type="datetime"></changed-at>
  <changes type="yaml">---
  - - M
    - /trunk/test/unit/changeset_test.rb
  - - M
    - /trunk/app/models/changeset.rb
  - - M
    - /trunk/db/schema.rb

  </changes>
  <revision>1234</revision>
  <title>bob committed changeset [1234]</title>
</changeset>
$ curl 'https://vidispine.lighthouseapp.com/projects/86877/changesets.xml?page=1&_token=zap' -X POST -Hcontent-type:application/xml  -d@c.xml
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Changes should be an array of arrays of strings like this: &quot;--- \n- - M\n  - /foo/bar/baz\n- - A\n  - /foo\n&quot;</error>
</errors>
  1. 1 Posted by Julien on 29 Nov, 2011 09:53 PM

    Julien's Avatar

    Hi Isak,

    The format is slightly different for POST. If you look at the documentation, you should instead submit this:

    <changeset>
      <body></body>
      <body-html></body-html>
      <changed-at type="datetime"></changed-at>
      <changes type="yaml">---
      - A /foo/bar.rb
      - M /foo/bar.rb
      </changes>
      <revision>1234</revision>
      <title>bob committed changeset [1234]</title>
    </changeset>
    

    The easiest way to generate the YAML part is generally to go through a dedicated library for your language, rather than trying to create the string manually.

    Let me know if you have any other question.

  2. Julien closed this discussion on 29 Nov, 2011 09:53 PM.

Discussions are closed to public comments.
If you need help with Lighthouse please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac