| 1 | package OpenAPI; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | our $VERSION = '0.001'; | ||
| 7 | |||
| 8 | 1; | ||
| 9 | |||
| 10 | =head1 NAME | ||
| 11 | |||
| 12 | OpenAPI - A high-level implementation of the OpenAPI specification | ||
| 13 | |||
| 14 | =head1 DESCRIPTION | ||
| 15 | |||
| 16 | This module's functionality is entirely I<in potentiam>, which means I've not | ||
| 17 | written it yet. | ||
| 18 | |||
| 19 | The immediate purpose of it is to make sure there's something sensible in the | ||
| 20 | top-level namespace on the CPAN itself. | ||
| 21 | |||
| 22 | =head1 PLAN | ||
| 23 | |||
| 24 | =over | ||
| 25 | |||
| 26 | =item Create a set of classes that represent the types that the specification | ||
| 27 | lays out. | ||
| 28 | |||
| 29 | =item Create a validator that will validate an OpenAPI schema against the | ||
| 30 | OpenAPI specification. | ||
| 31 | |||
| 32 | =item Create a validator that will validate a Perl data structure against a | ||
| 33 | (valid) schema. | ||
| 34 | |||
| 35 | =item Create a system to produce a schema or set of schemata in a manner | ||
| 36 | agnostic to the URI schema, or lack thereof, on which the schema is served. | ||
| 37 | |||
| 38 | =item Somehow understand the URIs in the document, especially with regards to | ||
| 39 | the templated paths, such that the URI schema can be introspected, allowing for | ||
| 40 | integration with the various frameworks. | ||
| 41 | |||
| 42 | =item Understand hyperlinks within a third-party schema and denormalise, or | ||
| 43 | lazily fetch referenced schemata as required. | ||
| 44 | |||
| 45 | =item Conversely, have hyperlinks within a local schema that don't actually | ||
| 46 | have URIs associated with them yet. | ||
| 47 | |||
| 48 | =back | ||
| 49 | |||
| 50 | The idea is to be able to either parse or produce OpenAPI schemata and then | ||
| 51 | validate documents against it. When the OpenAPI schema is parsed it should look | ||
| 52 | the same as if it had been created locally, modulo lazy fetching of references. | ||
| 53 | That means that when a parsed schema is rendered out to JSON, it should look | ||
| 54 | the same as the original document. | ||
| 55 | |||
| 56 | Probably the sane way to do this would be to have the API object be a level | ||
| 57 | above the schemata themselves, as a sort of collection object, holding | ||
| 58 | sufficient information to reconstruct URIs absolutely, or resolve them | ||
| 59 | relatively. |