Sha256: 83074717a33418726fd57b10c5e757db1d7d64da7b2bc5ab40fb114ab7b9fc38

Contents?: true

Size: 415 Bytes

Versions: 1

Compression:

Stored size: 415 Bytes

Contents

module JsonSchemaRails
  class SchemasController < ApplicationController
    def get
      schema = JsonSchemaRails.lookup_schema(params[:schema])
      raise ActionController::RoutingError.new('No Such Schema') unless schema

      respond_to do |format|
        format.yaml { render text: schema.to_hash.to_yaml, content_type: 'text/yaml' }
        format.json { render json: schema }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
json_schema_rails-0.1.0 app/controllers/json_schema_rails/schemas_controller.rb