opendata-for-all / wapiml

An OpenAPI round-trip tool that leverages model-driven techniques to create, visualize, manage, and generate OpenAPI definitions.
Eclipse Public License 2.0
69 stars 18 forks source link

Consider using the generated code (EClasses) to obtain Stereotypes #13

Closed abelgomez closed 5 years ago

abelgomez commented 5 years ago

Now that the profile provide an EMF API (see https://github.com/opendata-for-all/openapi-profile/issues/2), it should be possible to obtain the Stereotypes from the generated Java code rather than hardcoding the Strings in the code.

See some examples in:

https://github.com/dice-project/DICE-Simulation/blob/f829c7b353aa7234c033553596e1330541df8023/bundles/es.unizar.disco.simulation.models/src/es/unizar/disco/simulation/models/definition/impl/CustomSimulationDefinitionImpl.java#L66

and

https://github.com/dice-project/DICE-Simulation/blob/master/bundles/es.unizar.disco.simulation.models/src/es/unizar/disco/simulation/models/util/MarteStereotypesUtils.java

abelgomez commented 5 years ago

This relates to #10 , where the stereotype is applied as property.getApplicableStereotype("OpenAPIProfile::APIProperty")

hamzaed commented 5 years ago

Thank you Abel for the tip. I'll give it a try. Indeed, using fully qualified names to retrieve stereotypes has limitations.