Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
daveih committed Mar 6, 2024
1 parent 4f8ef44 commit d56e8e8
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,31 @@ To generate the OpenAPI specifications in both YAML and JSON format use the scri
```
. ./api_docs.sh
```
This script employs the openapi.py utility
This script employs the openapi.py utility

# Style

## Attribute Name

Attribute names refect the UML model for all simple type attributes and all relationships. Where a relationship is turned into a cross reference (so as not to include the content twice in the serialization) either Id or Ids is appended to the attribute name for 1 to 1 or 1 to many relationship respectively. When Id or Ids is appended the root attribute name may be altered so as to make the new name readble, for example the attribute 'children' becomes 'childIds'.

## Attribute Definition

The following coding style is used in attribute definitions. For required simple type attributes the coding convention used is as follows:

Required: ```attributeName: typeName```
Optional: ```attributeName: typeName = None```

The convention used for relationships and cardinality is as follows

For 1:1: ```attributeName: ClassName```
For 1:0..1: ```attributeName: Union[ClassName, None] = None```
For 1:1..*: ```attributeName: [ClassName]```
For 1:0..*: ```attributeName: [ClassName] = []```

For cross references (note the addition of 'Id' or 'Ids')

For 1:1: ```attributeNameId: str```
For 1:0..1: ```attributeNameId: Union[str, None] = None```
For 1:1..*: ```attributeNameIds: [str]```
For 1:0..*: ```attributeNameIds: [str] = []```

0 comments on commit d56e8e8

Please sign in to comment.