Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Specification.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Framework_WebService_OpenAPI_Basic_h_
5#define _Stroika_Framework_WebService_OpenAPI_Basic_h_ 1
6
7#include "Stroika/Frameworks/StroikaPreComp.h"
8
9#include "Stroika/Foundation/Containers/Sequence.h"
15
16/*
17 */
18
19/*
20 * \note Code-Status: <a href="Code-Status.md#Alpha">Alpha</a>
21 *
22 * SUPER DUPER ROUGH DRAFT
23 */
24
25namespace Stroika::Frameworks::WebService::OpenAPI {
26
27 using namespace Stroika::Foundation;
28
31 using IO::Network::URI;
32
33 // https://stackoverflow.com/questions/52541842/what-is-the-media-type-of-an-openapi-schema
34 inline const DataExchange::InternetMediaType kMediaType{"application/openapi+json"sv};
35
36 // very early rough draft - for now - represnet as a VariantValue
37 class Specification {
38 public:
39 /**
40 */
41 Specification (const VariantValue& v);
42 Specification (const Streams::InputStream::Ptr<byte>& b, const optional<DataExchange::InternetMediaType>& mediaType = {});
43 Specification (const Specification&) = default;
44
45 public:
46 /**
47 */
48 nonvirtual Sequence<URI> GetServers () const;
49
50 public:
51 /**
52 */
53 nonvirtual void SetServers (const Sequence<URI>& s);
54
55 public:
56 /**
57 * So far only kMediaType supported.
58 */
59 template <typename T>
60 nonvirtual T As () const
61 requires (same_as<T, VariantValue>);
62 nonvirtual Memory::BLOB As (const DataExchange::InternetMediaType& mediaType);
63
64 private:
65 VariantValue fValue_;
66 };
67
68}
69
70/*
71 ********************************************************************************
72 ***************************** Implementation Details ***************************
73 ********************************************************************************
74 */
75#include "Specification.inl"
76
77#endif /*_Stroika_Framework_WebService_OpenAPI_Basic_h_*/
A generalization of a vector: a container whose elements are keyed by the natural numbers.
Definition Sequence.h:187
Simple variant-value (case variant union) object, with (variant) basic types analogous to a value in ...
InputStream<>::Ptr is Smart pointer (with abstract Rep) class defining the interface to reading from ...