Giter Site home page Giter Site logo

automates-v2's People

Contributors

cl4yton avatar dpdicken avatar kwalcock avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

automates-v2's Issues

Some loose ends

In creating a (de)serializer for Scala (in https://github.com/kwalcock/skema), I noticed these issues, which are probably known, but here are some notes just in case:

  • Several uids are still strings and don't have format uuid.
  • The values of LitervalValue and TypedValue are just objects with no properties.

metadata_collection of gromet_FN needs polymorphism

It looks like

        metadata_collection:
          description: |
            Table (array) of lists (arrays) of metadata,
            where each list in the Table-array represents the collection
            of metadata associated with a GroMEt object.
          type: array  # The Table of metadata_collection(s) (lists)
          items:
            type: array  # Collection (list) of metadata associated with a particular GroMEt object.
            items:
              $ref: "#/components/schemas/Metadata"

means that anything that includes an

      allOf:
        - $ref: '#/components/schemas/Metadata'

is allowed. In order for code generation to work, some things need to be added, including a discriminator and probably oneOf. See also https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/.

Code generation and need for discriminator

Java/Scala code generation doesn't work from files like gromet_FN_v0.1.4.yaml and gromet_metadata_v0.1.4.yaml for lack of a discriminator in superclasses. For example,

    GrometObject:
      description: Generic base class for any GroMEt object
      type: object
      properties:
        metadata:
          description: Index (integer) into the metadata_collection table in GrometFNModule.
          type: integer
# Lines like the ones below need to be added     
        gromet_object_type: # added
          type: string #
      discriminator: # added
        propertyName: gromet_object_type

When subclass objects are written out, a field should then appear as such:

{
    "gromet_object_type": "GrometFNModule",
    "schema": "FN",
    "schema_version": "0.1.4",

This allows the generated Java/Scala code to figure out how to deserialize the object.

I don't (yet) know how the Python code is working without this, but will probably notice soon. I am hand editing the files like cond1--Gromet-FN-auto.json to add this information to make sure the updates to the yaml file that I'm about to suggest work.

Perhaps this issue has been encountered before, so I'm filing this slightly prematurely in case there's more I should know before continuing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.