Last active
May 12, 2021 17:33
-
-
Save lmazuel/69dcd7447c6aa10ffd2dbd5a94bb2dd6 to your computer and use it in GitHub Desktop.
LLC view brainstorm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from m4 | |
intpu = "code-model-+no-tags.yuaml" | |
model = yaml.parse(input) | |
main_view : LLCClientView = process_model(model) | |
# from Swagger | |
input = "myswagger.json" | |
main_view : LLCClientView = process_swagger(input) | |
# If I wan to | |
main_view = LLCClientView(name="DocumentTranslationClient") | |
main_view.add_operation(LLCOperationView( | |
name="CancelOperation", | |
parameter=ParameterView( | |
type="string(guid)", | |
namea="id" | |
) | |
)) | |
def to_json(): # LLCClientView | |
for operation in self.operations: | |
operation.to_json() | |
main_view.operations[0].to_json() | |
main_view.serialize() | |
main_view.to_json() # produces the API view JSON | |
import json | |
json.dumps(main_view, encoder=APIViewEncoder()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment