Currently, the aptos.util module contains a class Parser with a static method parse to parse JSON formatted specifications.
Ideally, the Parser class should serve more as an interface for concrete parser classes to implement. Therefore, the Parser.parse method should raise a NotImplementedError.
class Parser:
"""Parser interface"""
@staticmethod
def parse(instance):
raise NotImplementedError()
class JSONSchemaParser(Parser):
@staticmethod
def parse(instance):
# Algorithm for parsing JSON schema documents
Currently, the
aptos.utilmodule contains a classParserwith a static methodparseto parse JSON formatted specifications.Ideally, the
Parserclass should serve more as an interface for concrete parser classes to implement. Therefore, theParser.parsemethod should raise aNotImplementedError.