package OpenAPI::Render;
use strict;
use warnings;
use Clone qw( clone );
use JSON qw( decode_json );
use version;
# ABSTRACT: Render OpenAPI specifications as documents
our $VERSION = '0.3.0'; # V
raw JSON or parsed data structure, constructs a C<OpenAPI::Render> object.
Does not modify input values.
=cut
sub new
{
my( $class, $api ) = @_;
if( ref $api ) {
# Parsed JSON give
ing will modify it.
$api = clone $api;
} else {
# Raw JSON given, need to parse.
$api = decode_json $api;
}
my $self = { api => _dereference( $api, $api ) };