func readOp(s *spec.Spec, n *gen.Type) (*spec.Operation, error) {
	ant, err := schemaAnnotation(n)
	if err != nil {
		return nil, err
	}
	v, err := newView(n, ant.ReadGroups)
	if err != nil {
		return nil, err
	}
	rspName, err := v.Name()
	if err != nil {
		return nil, err
	}
	t, err := oasType(n.ID)
	if err != nil {
		return nil, err
	}
	return &spec.Operation{
		Summary:     fmt.Sprintf("Find a %s by ID", n.Name),
		Description: fmt.Sprintf("Finds the %s with the requested ID and returns it.", n.Name),
		Tags:        []string{n.Name},
		OperationID: opRead + n.Name,
		Parameters: []*spec.Parameter{{
			Name:        "id",
			In:          spec.InPath,
			Description: fmt.Sprintf("ID of the %s", n.Name),
			Required:    true,
			Schema:      *t,
		}},
		Responses: map[string]*spec.OperationResponse{
			strconv.Itoa(http.StatusOK): {
				Response: spec.Response{
					Description: fmt.Sprintf("%s with requested ID was found", n.Name),
					Headers:     nil, // TODO
					Content: &spec.Content{
						spec.JSON: spec.MediaTypeObject{
							Unique: true,
							Ref:    s.Components.Schemas[rspName],
						},
					},
				},
			},
			strconv.Itoa(http.StatusBadRequest):          {Ref: s.Components.Responses[strconv.Itoa(http.StatusBadRequest)]},
			strconv.Itoa(http.StatusNotFound):            {Ref: s.Components.Responses[strconv.Itoa(http.StatusNotFound)]},
			strconv.Itoa(http.StatusInternalServerError): {Ref: s.Components.Responses[strconv.Itoa(http.StatusInternalServerError)]},
		},
		Security: ant.ReadSecurity,
	}, nil
}
// readOp returns a spec.Operation for a read operation on the given node.
readOp returns a spec.Operation for a read operation on the given node.
// readOp returns a spec . Operation for a read operation on the given node .
func readOp(s *spec.Spec, n *gen.Type) (*spec.Operation, error) {
	ant, err := schemaAnnotation(n)
	if err != nil {
		return nil, err
	}
	v, err := newView(n, ant.ReadGroups)
	if err != nil {
		return nil, err
	}
	rspName, err := v.Name()
	if err != nil {
		return nil, err
	}
	t, err := oasType(n.ID)
	if err != nil {
		return nil, err
	}
	return &spec.Operation{
		Summary:     fmt.Sprintf("Find a %s by ID", n.Name),
		Description: fmt.Sprintf("Finds the %s with the requested ID and returns it.", n.Name),
		Tags:        []string{n.Name},
		OperationID: opRead + n.Name,
		Parameters: []*spec.Parameter{{
			Name:        "id",
			In:          spec.InPath,
			Description: fmt.Sprintf("ID of the %s", n.Name),
			Required:    true,
			Schema:      *t,
		}},
		Responses: map[string]*spec.OperationResponse{
			strconv.Itoa(http.StatusOK): {
				Response: spec.Response{
					Description: fmt.Sprintf("%s with requested ID was found", n.Name),
					Headers:     nil, 
					Content: &spec.Content{
						spec.JSON: spec.MediaTypeObject{
							Unique: true,
							Ref:    s.Components.Schemas[rspName],
						},
					},
				},
			},
			strconv.Itoa(http.StatusBadRequest):          {Ref: s.Components.Responses[strconv.Itoa(http.StatusBadRequest)]},
			strconv.Itoa(http.StatusNotFound):            {Ref: s.Components.Responses[strconv.Itoa(http.StatusNotFound)]},
			strconv.Itoa(http.StatusInternalServerError): {Ref: s.Components.Responses[strconv.Itoa(http.StatusInternalServerError)]},
		},
		Security: ant.ReadSecurity,
	}, nil
}
func readOp ( s * spec . Spec , n * gen . Type ) ( * spec . Operation , error ) { ant , err := schemaAnnotation ( n ) if err != nil { return nil , err } v , err := newView ( n , ant . ReadGroups ) if err != nil { return nil , err } rspName , err := v . Name ( ) if err != nil { return nil , err } t , err := oasType ( n . ID ) if err != nil { return nil , err } return & spec . Operation { Summary : fmt . Sprintf ( " " , n . Name ) , Description : fmt . Sprintf ( " " , n . Name ) , Tags : [ ] string { n . Name } , OperationID : opRead + n . Name , Parameters : [ ] * spec . Parameter { { Name : " " , In : spec . InPath , Description : fmt . Sprintf ( " " , n . Name ) , Required : true , Schema : * t , } } , Responses : map [ string ] * spec . OperationResponse { strconv . Itoa ( http . StatusOK ) : { Response : spec . Response { Description : fmt . Sprintf ( " " , n . Name ) , Headers : nil , Content : & spec . Content { spec . JSON : spec . MediaTypeObject { Unique : true , Ref : s . Components . Schemas [ rspName ] , } , } , } , } , strconv . Itoa ( http . StatusBadRequest ) : { Ref : s . Components . Responses [ strconv . Itoa ( http . StatusBadRequest ) ] } , strconv . Itoa ( http . StatusNotFound ) : { Ref : s . Components . Responses [ strconv . Itoa ( http . StatusNotFound ) ] } , strconv . Itoa ( http . StatusInternalServerError ) : { Ref : s . Components . Responses [ strconv . Itoa ( http . StatusInternalServerError ) ] } , } , Security : ant . ReadSecurity , } , nil }
readOp returns a spec.Operation for a read operation on the given node.
readOp returns a spec . Operation for a read operation on the given node .
// TODO