Giter VIP home page Giter VIP logo

Comments (3)

ajbalogh avatar ajbalogh commented on August 21, 2024

In the sample a pattern is being assigned to the field.
Also it will be up to the code generator to create whatever names it wants for classes, when the payload gets serialized to json there will be no named pattern, just a choice and a child property that details the choice.

from models.

ashutshkumr avatar ashutshkumr commented on August 21, 2024

Agree with not having to worry about named pattern when on wire (or serialized to json).

The problem I noticed was that I had to cast the field values to str() while creating the config - this does not affect all use cases though. e.g.

# from scapy
v1 = Dot1Q(id=[1, 3, 5])
# had to use
v2 = FlowVlan(id=NumField(choice='list', list=[str(id) for id in v1.id]))
# instead of
v2 = FlowVlan(id=NumField(choice='list', list=v1.id)) 

I figured we might come across more such hiccups.

from models.

ajbalogh avatar ajbalogh commented on August 21, 2024

At this time we are only supporting string values for field patterns.

from models.

Related Issues (20)

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.