“API Blueprint MiniTest Rails” Respostas de código

API Blueprint MiniTest Rails

- address
    - street
    - city
    - state
Annoying Armadillo

API Blueprint MiniTest Rails

require 'json_matchers/minitest/assertions'
JsonMatchers.schema_root = 'test/support/schemas'
Minitest::Test.send(:include, JsonMatchers::Minitest::Assertions)
Annoying Armadillo

API Blueprint MiniTest Rails

$ bin/yarn add "https://github.com/mariochavez/apib2json.git#additional-metadata"
Annoying Armadillo

API Blueprint MiniTest Rails

$ bin/yarn add aglio
Annoying Armadillo

API Blueprint MiniTest Rails

{
    "address" : {
        "street": "",
        "city": "",
        "state": ""
    }
}
Annoying Armadillo

API Blueprint MiniTest Rails

$ bin/rails api:schemas
Generating api schemas from docs/api/documentation.md
yarn run v1.7.0
$ node_modules/.bin/apib2json --pretty -i docs/api/documentation.md -o test/support/schemas/schemas.json
Done in 0.31s.
Writing GET-Users-200
Writing POST-Users-201
Writing POST-Users-422
Schemas are ready at test/support/schemas
Annoying Armadillo

API Blueprint MiniTest Rails

namespace :api do
  desc 'Build API documentation'
  task :documentation do
    input_file = 'docs/api/documentation.md'
    output_file = 'public/documentation.html'
    system(" bin/yarn run aglio -i #{input_file}  -o #{output_file}")
  end
end
Annoying Armadillo

API Blueprint MiniTest Rails

$ bin/yarn run aglio -i docs/api/documentation.md -o public/documentation.html
Annoying Armadillo

Respostas semelhantes a “API Blueprint MiniTest Rails”

Perguntas semelhantes a “API Blueprint MiniTest Rails”

Procure respostas de código populares por idioma

Procurar outros idiomas de código