Closed jryannel closed 2 months ago
You can add now interfaces as part of your references:
module demo 1.0
interface Common {
value3: int
}
interface Counter {
getCommon(): Common
}
name: demo
version: "1.0"
interfaces:
- name: Common
- name: Counter
operations:
- name: getCommon
return:
type: Common
Will result into code like
package demo
// Data Structures
type Common interface {
// Methods
}
type Counter interface {
// Methods
GetCommon() Common
}
In the filters only the interface case needs to be handled:
func ToReturnString(prefix string, schema *model.Schema) (string, error) {
...
case model.TypeInterface:
text = fmt.Sprintf("%s%s", prefix, schema.Type)
...
}
We will not implement this. We expect interfaces can not be used a references.
Allow interfaces to be used in the API surface, they should already be usable but it is not sure if all templates support them.
Here is an example:
To make this work we need to ensure that all filters in all technologies do return interfaces.
We need also decide if interfaces in structs are allowed?