Swagger::Schema::Kubernetes - Object model to Kubernetes Swagger / OpenAPI schema files
use File::Slurp; my $data = read_file($swagger_file); my $schema = Swagger::Schema::Kubernetes->MooseX::DataModel::new_from_json($data); # use the object model say "This API consists of:"; foreach my $path (sort keys %{ $schema->paths }){ foreach my $http_verb (sort keys %{ $schema->paths->{ $path } }) { say "$http_verb on $path"; } }
Get programmatic access to Kubenertes Swagger / OpenAPI files.
This module builds upon Swagger::Schema to produce the same object model, enabling access to the extra properties that the Kubernetes swagger definitions adds.
The object model is defined with MooseX::DataModel. Take a look at the lib/Swagger/Schema/Kubernetes.pm and lib/Swagger/Schema.pm files or the swagger spec to know what you can find inside the objects
lib/Swagger/Schema/Kubernetes.pm
lib/Swagger/Schema.pm
https://github.com/kubernetes/kubernetes/tree/master/api/openapi-spec
https://github.com/OAI/OpenAPI-Specification
http://swagger.io
Jose Luis Martinez CAPSiDE jlmartinez@capside.com
The source code is located here: https://github.com/pplu/swagger-schema-kubernetes
Please report bugs to: https://github.com/pplu/swagger-schema-kubernetes/issues
Copyright (c) 2018 by CAPSiDE
This code is distributed under the Apache 2 License. The full text of the license can be found in the LICENSE file included with this module.
To install Swagger::Schema::KubernetesGroupVersionKind, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Swagger::Schema::KubernetesGroupVersionKind
CPAN shell
perl -MCPAN -e shell install Swagger::Schema::KubernetesGroupVersionKind
For more information on module installation, please visit the detailed CPAN module installation guide.