rest - RAML 1.0 ciclical nested includes -
i have issue, have created 2 libraries define 2 different types, here are:
category.raml
#%raml 1.0 library uses: - event: !include event.raml - tournament: !include tournament.raml types: ############################################################################# base: usage: base type category properties: min_age: description: minimum age participate in category required: true type: number max_age: description: maximum age participate in category required: true type: number name: description: name of category required: true type: string gender: description: gender of category required: true enum: - male - female - mix tournament: description: tournament of category required: true type: tournament.base ############################################################################# full: usage: category of events type: base properties: events: description: events category contains required: true type: event.base[]
tournament.raml
#%raml 1.0 library uses: - clubinscription: !include club.raml - category: !include category.raml types: ############################################################################# base: usage: base type tournament properties: name: description: name of tournament required: true type: string date: description: date of tournament required: true type: string available_lanes: description: maximum number of lanes in serie required: true type: number max_swimmer_inscriptions: description: maximum number of events swimmer may inscripted required: true type: number award_type: description: type of awarding used in competition required: true enum: - points - medals - none state: description: current state of tournament required: true enum: - closed - open - finished ############################################################################# full: usage: tournament categories , club inscriptions type: base properties: club_inscriptions: description: clubs inscripted in tournament required: true type: clubinscription.base[] categories: description: categories tournament has required: true type: category.base[]
having this, makes sense having conflict. pretty knew @ raml, read somewhere "uses" should used when using parent, should not re-write in everywhere in project (because happens everywhere in it).
i have thought of defining base of types in 1 file, mix of information should not together, want know if there alternative "uses" re-use types in file.
thanks in advance.
the simplest solution make:
- tournamentbase.raml
- tournamentfull.raml
- categorybase.raml
- categoryfull.raml
you not have circular dependencies.
Comments
Post a Comment