From ea48310579385c86cd6da9663e8150701707452d Mon Sep 17 00:00:00 2001 From: Katarzyna Kobierska Date: Wed, 7 Sep 2016 12:54:02 +0200 Subject: [PATCH] Improve curl commend, remove blank lines --- doc/api/ci/lint.md | 2 +- lib/api/lint.rb | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/api/ci/lint.md b/doc/api/ci/lint.md index 080bc2148f3..0c96b3ee335 100644 --- a/doc/api/ci/lint.md +++ b/doc/api/ci/lint.md @@ -13,7 +13,7 @@ POST ci/lint | `content` | string | yes | the .gitlab-ci.yaml content| ```bash -curl -H "Content-Type: application/json" --request POST https://gitlab.example.com/api/v3/ci/lint -d '{"content": "{ \"image\": \"ruby:2.1\", \"services\": [\"postgres\"], \"before_script\": [\"gem install bundler\", \"bundle install\", \"bundle exec rake db:create\"], \"variables\": {\"DB_NAME\": \"postgres\"}, \"types\": [\"test\", \"deploy\", \"notify\"], \"rspec\": { \"script\": \"rake spec\", \"tags\": [\"ruby\", \"postgres\"], \"only\": [\"branches\"]}}"}' +curl --header "Content-Type: application/json" https://gitlab.example.com/api/v3/ci/lint --data '{"content": "{ \"image\": \"ruby:2.1\", \"services\": [\"postgres\"], \"before_script\": [\"gem install bundler\", \"bundle install\", \"bundle exec rake db:create\"], \"variables\": {\"DB_NAME\": \"postgres\"}, \"types\": [\"test\", \"deploy\", \"notify\"], \"rspec\": { \"script\": \"rake spec\", \"tags\": [\"ruby\", \"postgres\"], \"only\": [\"branches\"]}}"}' ``` Be sure to copy paste the exact contents of `.gitlab-ci.yml` as YAML is very picky about indentation and spaces. diff --git a/lib/api/lint.rb b/lib/api/lint.rb index 8a7ced2d34d..ae43a4a3237 100644 --- a/lib/api/lint.rb +++ b/lib/api/lint.rb @@ -1,12 +1,10 @@ module API class Lint < Grape::API - namespace :ci do desc 'Validation of .gitlab-ci.yml content' params do requires :content, type: String, desc: 'Content of .gitlab-ci.yml' end - post '/lint' do error = Ci::GitlabCiYamlProcessor.validation_message(params[:content])